ustrdup(3)
β¨ NAME β¨
Okay bestie, meet ustrdup(3) β the Allegro manual's little string-duplicating icon. It's literally in the Allegro game programming library, and it does exactly what it says: duplicates a string. No cap. π
πΈ SYNOPSIS πΈ
#include <allegro.h>
char *ustrdup(const char *src)
π¦ DESCRIPTION π¦
Okay so this function copies the null-terminated string src into a newly allocated area of memory β effectively duplicating it, like a clone but for chars. β¨ iconic β¨
Example, because seeing it is believing:
void manipulate_string(const char *input_string)
{
char *temp_buffer = ustrdup(input_string);
/* Now we can modify temp_buffer */
...
π RETURN VALUE π
It returns the newly allocated string, bestie. But listen: this memory must be freed by the caller β that's you, so don't ghost it. π«Ά It returns NULL if it cannot allocate space for the duplicated string. Periodt. π
π SEE ALSO π
Allegro version 4.4.3, and that's the footer tea. The date didn't show up, but the vibes are timeless. Bye bestie! π
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms