Copies not more than maxchar characters from source into dest. Format #include <string.h> char *strncpy (char *dest, const char *source, size_t maxchar);
1 – Function Variants
The strncpy function has variants named _strncpy32 and _strncpy64 for use with 32-bit and 64-bit pointer sizes, respectively.
2 – Arguments
dest Pointer to the destination character string. source Pointer to the source character string. maxchar The maximum number of characters to copy from source to dest up to but not including the null terminator of source.
3 – Description
The strncpy function copies no more than maxchar characters from source to dest, up to but not including the null terminator of source. If source contains less than maxchar characters, dest is padded with null characters. If source contains greater than or equal to maxchar characters, as many characters as possible are copied to dest. Be aware that the dest argument might not be terminated by a null character after a call to strncpy.
4 – Return Value
x The address of dest.