![]() | Programming Guide | ![]() ![]() ![]() ![]() |
Allocate memory and copy a string to that memory
char *sm_strdup(char *string);
- string
- The string to be duplicated.
.If string is not the null pointer, its length is found, sm_fmalloc is called and if it did not return the null pointer, string is copied to the allocated memory. Memory allocated by calling sm_strdup should be freed by calling sm_ffree.