STRINS(3pub)
π STRINS(3pub) π
okay bestie, welcome to the publib corner of the C Programmer's Manual β¨ this one lives in section 3pub and it's genuinely so simple you're gonna be obsessed π«Ά
β¨ NAME β¨
strins β insert a string at the beginning of another string πΈ
like. that's it. that's the whole job. no cap. π
β¨ SYNOPSIS β¨
#include <publib.h>
char *strins(char *tgt, const char *src);
β¨ DESCRIPTION β¨
so here's the tea β strins inserts the src string at the beginning of the tgt string. front of the line. first in the queue. main character position. π
β οΈ but bestie, listen: the strings must not overlap. do not do that. fr fr.
β οΈ also, the target string must contain enough memory to hold both strings. you gotta have the room already. strins is not out here doing your memory math for you, she's just inserting. π
β¨ RETURN VALUE β¨
strins returns its first argument. that's it. she hands you back the tgt pointer you gave her. iconic behaviour, honestly. π
β¨ EXAMPLE β¨
not me giving you homework β but the example lives over in the manual page for strdel(3). go peek there. π¦
β¨ SEE ALSO β¨
β¨ AUTHOR β¨
Lars Wirzenius (lars.wirzenius@helsinki.fi) π thank you king
Publib π C Programmer's Manual π and yeah, that's the STRINS(3pub) page, bestie β go forth and insert your little strings at the front, and remember: no overlap, and enough memory or it's giving π π
π¦ where this page comes from
- debian bookworm: publib-dev 0.40-3+b1 Β· BSD-2-Clause
- debian trixie: publib-dev 0.40-4 Β· BSD-2-Clause
- ubuntu jammy: publib-dev 0.40-3build1 Β· BSD-2-Clause
- ubuntu noble: publib-dev 0.40-3build1 Β· BSD-2-Clause
- ubuntu questing: publib-dev 0.40-4
- ubuntu resolute: publib-dev 0.40-4build1 Β· BSD-2-Clause
- ubuntu stonking: publib-dev 0.40-4build1 Β· BSD-2-Clause
- Copyright (c) 1994-2006 Lars Wirzenius. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms