可以使用strcat函數(shù)將三個(gè)字符串連接起來(lái)。
#include <stdio.h>
#include <string.h>
int main() {
char str1[50] = "Hello";
char str2[] = "C";
char str3[] = "Language";
char result[100];
strcpy(result, str1);
strcat(result, str2);
strcat(result, str3);
printf("Result: %s\n", result);
return 0;
}
輸出結(jié)果為:Result: HelloCLanguage