ustrdup
Duplicates a string. Allegro game programming library.
- Provided by: allegro4-doc (Version: 2:4.4.3.1-4.1build3)
- Source: allegro4.4
- Report a bug
Duplicates a string. Allegro game programming library.
#include <allegro.h>
char *ustrdup(const char *src)
This functions copies the null-terminated string `src' into a newly allocated area of memory, effectively duplicating it. Example:
void manipulate_string(const char *input_string)
{
char *temp_buffer = ustrdup(input_string);
/* Now we can modify temp_buffer */
...
Returns the newly allocated string. This memory must be freed by the caller. Returns NULL if it cannot allocate space for the duplicated string.
_ustrdup(3alleg4), uconvert(3alleg4), ustrsize(3alleg4), ustrsizez(3alleg4), exconfig(3alleg4)