21、连接字符串的方法

连接两个字符串:

1、  用sprintf函数,具体见sprintf 部分。

2、  用strcat函数。char*strcat(char *dest, const char *src),输出参数是连接后的字符串,返回值是dest的指针。

3、  自己编写程序a[i+(k++)]=b[k++]。

发布了278 篇原创文章 · 获赞 31 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/hopegrace/article/details/104569697
今日推荐