strncat

 

Description

Append characters of a string.

Syntax

LPSTR strncat( LPSTR lpszDestination, LPCSTR lpcszSource, size_t count )

Parameters

lpszDestination
[modify] String that is appended to
lpcszSource
[input] String that is appended
count
[input] Number of characters to append

Return

Returns a pointer to the destination string with N characters from source string appended.

Examples

EX1

void strncat_ex1()
{
    char str1[]="Hello world from ";
    strncat( str1, "strcpy!xxxxxxxx", 7 );
    out_str( str1 ); // output is Hello world from strcpy!
}

Remark

Append the first N characters of one string to a second string.

See Also

header to Include

origin.h

Reference