123456789101112131415161718192021222324252627282930313233343536373839
#include <stdio.h> #include <string.h> #include <stdlib.h> int main( void ) { char first[7] = "Edward"; char second[8] = "Anthony"; char combine[20]; for(int a = 0; a < strlen(first); a++) { printf("%c\n", first[a]); } printf("\n\n"); for(int a = 0; a < strlen(second); a++) { printf("%c\n", second[a]); } strcat(combine, first); strcat(combine, second); for(int a = 0; a < strlen(combine); a++) { printf("%c", combine[a]); } getchar(); return 0; }
char combine[20] = {0};
123
strcat(combine, first); strcat(combine, " "); strcat(combine, second);