STREND(3pub)

✨ STREND πŸ’–

okay bestie, so this is a page straight out of the C Programmer's Manual β€” the publib crew's very own corner of it β€” and it's about one tiny little function that does exactly one tiny little thing and does it flawlessly. no cap. let's get into it πŸ¦‹


🌸 NAME 🌸

strend β€” returns a pointer to the terminating '\0' of a string

like. that's it. that's the whole job. and she ate. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <publib.h>
char *strend(const char *s);

you pull in <publib.h> (that's the header for the whole publib family, iykyk 🫢) and then you call strend with a const char *s and get a char * back. simple. iconic. no drama. ✨


πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the vibe: strend will return a pointer to the '\0' that terminates a string. 🎯

that's the entire personality. you hand her a string, she hands you back a pointer aimed right at the null terminator β€” the little '\0' at the very end that tells everyone else the string is done. she doesn't copy anything, she doesn't allocate anything, she doesn't touch your data (note the const on s, she's respectful πŸ™ˆ). she just points. lowkey the most well-behaved function in the whole library fr fr.


🌈 SEE ALSO 🌈

  • publib(3) β€” the whole squad, if you wanna meet the rest of the family πŸ’œ

πŸ’œ AUTHOR πŸ’œ

Lars Wirzenius (lars.wirzenius@helsinki.fi) β€” the legend, the moment, the main character who wrote this πŸ«ΆπŸ‘‘


okay and for the cute sign-off: this whole page lives in the Publib release, filed under the C Programmer's Manual πŸ’– so if you ever forget where you found it, it was right here in publib's section of the manual, babes. go point at some null terminators, you've got this πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from