STRDUP(3)

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

🌸 NAME 🌸

okay so bestie, welcome to the STRDUP(3) page from the Library Functions Manual, and the main character is strdup β€” duplicate nul-terminated string. πŸ’…βœ¨


✨ SYNOPSIS ✨

char* strdup(char* s)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea: strdup copies the nul-terminated string s to a new location provided by malloc(3) and returns a pointer to the new copy. it's giving fresh duplicate, same string energy, and the new location is literally from malloc(3). πŸ¦‹

and if malloc(3) failed? 0 is returned. yep, zero, that's the whole rule, no cap. 😭


πŸŽ€ SEE ALSO πŸŽ€

  • malloc(3) β€” the other page to check out, bestie. πŸ’–
  • memdup(3) β€” also in the SEE ALSO section, periodt. πŸŽ€

πŸ’– xoxo, your STRDUP(3) bestie from the Library Functions Manual β€” no date/version tea in the footer, so that's the whole page, periodt. πŸŽ€

πŸ“¦ where this page comes from