strncat

Syntax

char* strncat(char *dest, const char* src, int n)

Arguments

dest
The destination string to which the source string is to be appended.
src
The source string to be appended on the destination.
n
The number of characters from src to append.

Return

A pointer to the resulting string, this is identical to the pointer given as dest.

Description

Appends the first n characters of string src to the end of string dest, overwriting the NULL character at the end of dest with the first character of src up to n characters or it's terminating NULL character is reached. If string src is longer than n characters, a NULL character will also be added.
String dest must have enough space reserved for the resulting string, otherwise results may be undefined.

See Also

strcat