Table of Contents        Previous topic       Next topic       

C COMPILER LIBRARY FUNCTIONS->Detailed Descriptions->strncat()


#include <string.h>

char *strncat(char* string1, const char* string2, size_t n);Append one string to another


string1String to be extended
string2String to be appended
nNumber of characters to be appended


This function appends (concatenates), at most, n characters from string2 onto the tail of string1 to form an extended string string1.  If n is greater than the length of string2 then the length of string2 is used instead.

Both string1 and string2 must be null terminated strings and the resulting string1 is null terminated.

Return Value

The pointer to string1 is returned.