Defined in header
char *strdup( const char *str1 );
Returns a pointer to a null-terminated byte string, which is a duplicate of the string pointed to by
str1. The space for the new string is obtained as if the malloc was invoked. The returned pointer must be passed to free to avoid a memory leak.
If an error occurs, a null pointer is returned and errno might be set.
|str1||-||pointer to the null-terminated byte string to duplicate|
 Return value
A pointer to the newly allocated string, or a null pointer if an error occurred.
The function is identical to the POSIX strdup.
s2 = "Duplicate me!"
 See also
| allocates a copy of a string of specified size |
| copies one string to another |
| allocates memory |
| deallocates previously allocated memory |