您的位置:首页 > 编程语言 > C语言/C++

C语言字符函数----strcat(字符串拼接)

2019-03-01 19:22 567 查看

C语言字符函数----strcat(字符串拼接)
函数名:strcat
功 能:字符串拼接
举 例:将first_str与second_str进行拼接!
#include<string.h>
#include<stdio.h>
int main()
{
char first_str[20]=“hello “;
char *second_str=” world”;

printf(“原字符串—%s\n”,first_str);
strcat(first_str,second_str);

printf(“拼接后字符串—%s\n”,first_str);

return 0;
}
结果为:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐