Copy characeters from one string to another
char*strncpy( char *strDest,const char *strSource,size_t count );
The strncpy functioncopies the initial count characters of strSource to strDest andreturns strDest.If count is less than or equal to the lengthof strSource, a null character is not appended automatically to the copiedstring. If count is greater than the length of strSource,the destination string is padded with null characters up to length count.The behavior of strncpy is undefined if the source and destinationstrings overlap. strncpy does not check for sufficient space in strDest,it istherefor a potential cause of buffer overruns. Keep in mind that strDest mustbe large enough to hold strSource and the closing '\0'; otherwise, a buffer overrun can occur.
wchar_t *wcsncpy(wchar_t *strDest,const wchar_t *strSource,size_tcount);
wcsncpy isthe wide-character version of strncpy. The arguments and return valueof wcsncpy vary accordingly. These two functions behave identicallyotherwise.