Append a string.
#include <string.h> | Required only for function declarations |
char *strcat( char *string1, const char *string2 );
char __far * __far _fstrcat( char __far *string1, const char __far *string2 );
string1 | Destination string | |
string2 | Source string |
The strcat and _fstrcat functions append string2 to string1, terminate the resulting string with a null character, and return a pointer to the concatenated string (string1).
The strcat and _fstrcat functions operate on null-terminated strings. The string arguments to these functions are expected to contain a null character ('\0') marking the end of the string. No overflow checking is performed when strings are copied or appended.
The _fstrcat function is a model-independent (large-model) form of the strcat function. The behavior and return value of _fstrcat are identical to those of the model-dependent function strcat, with the exception that the arguments and return values are far pointers.
The return values for these functions are described above.
strcat
Standards:ANSI, UNIX
16-Bit:DOS, QWIN, WIN, WIN DLL
32-Bit:DOS32X
_fstrcat
Standards:None
16-Bit:DOS, QWIN, WIN, WIN DLL
32-Bit:None
strncat, strncmp, strncpy, _strnicmp, strrchr, strspn
/* STRCPY.C: This program uses strcpy and strcat to build a phrase. */
#include <string.h>
#include <stdio.h>
void main( void )
{
char string[80];
strcpy( string, "Hello world from " );
strcat( string, "strcpy " );
strcat( string, "and " );
strcat( string, "strcat!" );
printf( "String = %s\n", string );
}
String = Hello world from strcpy and strcat!