C examples for string.h:strcat
function
<cstring> <string.h>
Concatenate strings
char * strcat ( char * destination, const char * source );
Parameter | Description |
---|---|
destination | Pointer to the destination array, and large enough to contain the concatenated string. |
source | C string to be appended. |
destination is returned.
#include <stdio.h> #include <string.h> int main ()/*from w w w .ja v a2 s.c o m*/ { char str[80]; strcpy (str,"these "); strcat (str,"strings "); strcat (str,"are "); strcat (str,"concatenated."); puts (str); return 0; }