#include<stdio.h>
int main()
{
char s1[40],s2[20];
int i=0,j=0;
printf("input string1:");
scanf("%s",s1);
printf("input string2:");
scanf("%s",s2);
while(s1[i]!='\0') //for(i=0;c1[i]!='\0';i++)
//{}
i++; // for(j=0;c2[j]!='\0';i++,j++)
//c1[i]=c2[j];
//}*/
while(s2[j]!='\0')
s1[i++]=s2[j++];
s1[i]='\0';
printf("%s\n",s1);
return 0;
}
编程将两个字符串连接起来,不能使用strcat函数
最新推荐文章于 2023-02-10 22:17:41 发布