首页 > 其他分享 >c语言 字符串拼接

c语言 字符串拼接

时间:2023-02-13 20:39:22浏览次数:39  
标签:语言 ++ s2 s1 char int while 拼接 字符串


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++];
}


标签:语言,++,s2,s1,char,int,while,拼接,字符串
From: https://blog.51cto.com/u_15964288/6054677

相关文章