Duplicates a string.


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.
Examples using this:

Related Discussions

The following threads each have code containing this keyword: Note: You can click on the numbers to jump directly to the posts that reference this page.

Related Projects

The following projects include source code containing this keyword: