STRCOPY(3)

πŸ“¦ version 93vu, in opensuse-leap 16.0

πŸ’… STRCOPY(3) πŸ’…

ok so bestie, welcome to the Library Functions Manual β€” section 3, we're in the library functions section, it's giving very much "C standard library adjacent" energy and honestly? iconic. ✨


🌸 NAME 🌸

strcopy β€” copy strings πŸŽ€

like, that's the whole job. copying. strings. periodt.


πŸ¦‹ SYNOPSIS πŸ¦‹

char* strcopy(char* a, char* b)

so you call it with two char*s and it hands you back a char* β€” keep that in mind, we'll get to why in a sec πŸ‘€


✨ DESCRIPTION ✨

okay so here's the tea, bestie: strcopy copies the nul-terminated string b into a. 🫢

that's it. b goes in, a comes out the other side looking like b. no cap. the string b is nul-terminated (iykyk, there's a 0 chillin' at the end holding it all together πŸŽ€), and it gets copied into a.

and the return value? listen β€” this is the cute part β€” it returns a pointer to the 0 character in a. πŸ‘‘ not a pointer to the start of a, not the length, not a bool, just... straight to the nul. main character energy honestly. the 0 character said "I am the destination" and strcopy said "say less." πŸ’€

so like:

  • it copies the nul-terminated string b into a βœ…
  • it returns a pointer to the 0 character in a βœ…

that's the entire vibe. lowkey obsessed with how unbothered this function is. 🌈


πŸ”₯ SEE ALSO πŸ”₯

  • strcpy(3) β€” the cousin. the relative. go say hi. πŸ‘‹

πŸ’€ real talk bestie: this page does not tell you anything about buffer sizes, overlap, or what happens if things go sideways β€” so don't go assuming. stick to exactly what's written here and you'll stay slaying. 🧚

and that's the whole page, mwah πŸ’–

sign-off time, bestie: this little gem lives in the Library Functions Manual, page STRCOPY(3) β€” that's the title and the footer up in the corner, doing its little double duty, and no date in sight so we're just gonna call it ✨timeless✨. bye bestie, go copy some strings responsibly πŸŽ€πŸ’…πŸ¦‹

πŸ“¦ where this page comes from