可以使用strcat函数将三个字符串连接在一起,示例如下:
#include <stdio.h>
#include <string.h>
int main() {
char str1[50] = "Hello, ";
char str2[] = "world";
char str3[] = "!";
strcat(str1, str2);
strcat(str1, str3);
printf("%s\n", str1);
return 0;
}
输出结果为:
Hello, world!
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:c语言如何把三个字符串连起来