strncpy


Character string copy (with number of characters specified)

[Classification]

Standard library

[Syntax]

#include <string.h>

char *strncpy(char *dst, const char *src, size_t length);

[Return value]

Returns the value of dst.

[Description]

This function copies up to length characters (including the null character (\0)) from the array indicated by src to the array indicated by dst. If the array indicate by src is shorter than length characters, null characters (\0) are appended to the duplication in the array indicated by dst, until all length characters are written.