Copies a specified number of characters from one wide-character string to another string.
#include <wchar.h> wchar_t *wcsncpy ( wchar_t *ws1, const wchar_t *ws2, size_t n);
(OUT) Points to the array into which to copy the wide characters.
(IN) Points to the string containing the wide characters to copy.
(IN) Specifies the number of wide characters to copy.
Returns ws1.
The wcsncpy function copies no more than n characters from the string pointed to by ws2 into the array pointed to by ws1. Wide character codes that follow a null-terminating wide-character code are not copied. Copying of overlapping objects is not guaranteed to work properly.
If the string pointed to by ws2 is shorter than n characters, NULL characters are appended to the copy in the array pointed to by ws1, until n characters in all have been written. If the string pointed to by ws2 is longer than n characters, only n characters are copied and the ws1 string is not null terminated.