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; }
输出:
Value of first string is: helloc
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)