Concatenates two character arrays.
#include <string.h> char *strcat(char *dest, const char *source);
dest
The destination string.
source
The source string to append to dest.
This function appends a copy of the character array pointed to by source to the end of the character array pointed to by dest. The dest and source arguments must both point to null terminated character arrays. The function terminates the resulting character array with a null character.
The function returns the value of dest.
This facility may not be available on some configurations of the EWL.
#include <string.h> #include <stdio.h> int main(void) { /* Specify a destination string that has enough room to append s2. */ char s1[100] = "The quick brown fox "; char s2[] = "jumped over the lazy dog."; strcat(s1, s2); puts(s1); return 0; } Output: The quick brown fox jumped over the lazy dog.