C++:基础编程题
2020-12-25 19:28
阅读:624
标签:编程 void end cat containe pause 字符串 code main C++:基础编程题 标签:编程 void end cat containe pause 字符串 code main 原文地址:https://www.cnblogs.com/wt-seu/p/13039566.html
目录
字符数组与字符数组的连接
void strcat(char s[], char ct[]) {
int i=0, j=0;
while (s[i] != ‘\0‘) i++;
while (ct[j] != ‘\0‘) s[i++] = ct[j++];
s[i] = ‘\0‘;
}
int main(void) {
char a[40] = "wt ";
char b[20] = "is a postgraduate";
strcat(a, b);
cout
评论
亲,登录后才可以留言!