strncat


Character string concatenation (with number of characters specified)

[Classification]

Standard library

[Syntax]

#include <string.h>

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

[Return value]

Returns the value of dst.

[Description]

This function concatenates up to length characters (including the null character (\0) of src) to the end of the character string indicated by dst, starting from the beginning of the character string indicated by src. The null character (\0) at the end of dst is written over the first character of src. The null character indicating termination (\0) is always added to this result.

[Caution]

Because the null character (\0) is always appended when strncat is used, if copying is limited by the number of length arguments, the number of characters appended to dst is length + 1.