11.3. Concatenation Functions

11.3.1. The strcat function

Synopsis
#include <string.h>

void *strcat (void * s1 , const char * s2 );

Description

The strcat function appends a copy of the string pointed to by s2 (including the terminating null character) to the end of the string pointed to by s1. The initial character of s2 overwrites the null character at the end of s1. If copying takes place between objects that overlap, the behavior is undefined.

Returns

The strcat function returns the value of s1.

Implementation Notes

None.

11.3.2. The strncat function

Synopsis
#include <string.h>

void *strncat (void * s2 , const char * s2 , size_t n );

Description

The strncat function appends not more than n characters (a null character and characters that follow it are not appended) from the array pointed to by s2 to the end of the string pointed to by s1. The initial character of s2 overwrites the null character at the end of s1. A terminating null character is always appended to the result. If copying takes place between objects that overlap, the behavior is undefined.

Returns

The strncat function returns the value of s1.

Implementation Notes

None.