char *StrDup (const char stringToDuplicate[]);
Allocates and returns a copy of a string. The caller must dispose of the string using the free function.
Input | ||
Name | Type | Description |
stringToDuplicate | const char [] | Pass the string to be duplicated. |
Name | Type | Description |
duplicatedString | char * | Returns a pointer to a newly allocated memory block containing a copy of the stringToDuplicate. If there is not enough memory to copy the string or if stringToDuplicate is passed a value of zero, then a value of zero is returned. |