0
点赞
收藏
分享

微信扫一扫

c语言 字符串拼接

小迁不秃头 2023-02-13 阅读 85


void str_cat(char *s1, char *s2)
{
int i = 0, j = 0;
while (s1[i++]);
i--;
while (s1[i++] = s2[j++]);
}

void str_cat (char *s1, char *s2){
int i = 0, j = 0;
while (s1[i])
i++;
while (s2[j])
s1[i++] = s2[j++];
}


举报

相关推荐

0 条评论