字符串连接 strcat

 1 //字符串连接 strcat
 2 //将一个字符串连接到另一个字符串的末尾,组合成一个新字符串
 3 
 4 #include<stdio.h>
 5 #include<stdlib.h>
 6 #include<string.h>
 7 
 8 void main()
 9 {
10     char str1[200] = "加油,河南!!!";
11     char str2[30] = "加油,郑州!!!!!";
12     char str3[30] = "加油,中国!!!!!";
13 
14     //字符串连接
15     strcat(str1,str2);
16     printf("str1:%s\tstr2:%s str3:%s",str1,str2,str3);
17 }

 

posted on 2021-07-28 09:10  Bytezero!  阅读(125)  评论(0编辑  收藏  举报