strcat(first_string,second_string)函数连接两个字符串,结果返回给first_string。
#include<stdio.h>#include<string.h> int main(){ char ch[10]={'h', 'e', 'l', 'l', 'o', '\0'}; char ch2[10]={'c', '\0'}; strcat(ch,ch2); printf("Value of first string is: %s",ch); return 0; }
输出:
链接:https://www.learnfk.comhttps://www.learnfk.com/c-programming/c-strcat.html
来源:LearnFk无涯教程网
Value of first string is: helloc
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)
HarmonyOS快速入门与实战 -〔QCon+案例研习社〕