wchar_t *wcsdup(const wchar_t *s1);

wcsdup duplicates the wide string pointed to by s1 by using malloc to allocate memory for a copy of s and then copying s, including the terminating wide null character, to that memory. The returned pointer can be passed to free. wcsdup returns a pointer to the new wide string or a null pointer if the new string cannot be created.


wcsdup is an extension commonly found in Linux and BSD C libraries.