#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{
char d[20]="Golden Global"; //字符串定义和初始化的两种方法
char *s=" View";
printf("拼接前为:\nd=%s\ns=%s\n",d,s);
strcat(d,s); //字符串连接,s连接d的后面
printf("拼接后为:\nd=%s\n",d);
system("pause");
return 0;
}
实例31 字符串拼接
最新推荐文章于 2022-05-25 14:57:21 发布