C语言初学者,不知道这是什么情况😥,题目要求是编一个将两字符串连接起来而不用strcat函数🤔
scanf_s("%s", s1, 100);
...
scanf_s("%s", s2, 100);
#include <stdio.h>
int main()
{
char ch1[50],ch2[20],*p,*q;
gets(ch1);
gets(ch2);
p=ch1;q=ch2;
while(*p)p++;
while(*q)
{
*p=*q;
p++;q++;
}
*p='\0';
puts(ch1);
return 0;
}