strcat function code example
Example 1: string strcat function in c
#include <stdio.h>
#include <string.h>
int main() {
char str1[100] = "This is ", str2[] = "A Name";
strcat(str1, str2);
puts(str1);
puts(str2);
return 0;
}
Example 2: strcat
#include <stdio.h>
#include <string.h>
int main () {
char src[50], dest[50];
strcpy(src, "This is source");
strcpy(dest, "This is destination");
strcat(dest, src);
printf("Final destination string : |%s|", dest);
return(0);
}
Example 3: strcat
#include <stdio.h>
#include <string.h>
int main() {
char str1[100] = "This is ", str2[] = "programiz.com";
strcat(str1, str2);
puts(str1);
puts(str2);
return 0;
}