
#include<stdio.h>
int main()
{
void mystrcat(char *q1,char *q2);
char c1[20],c2[20];
char *p1,*p2;
printf("请输入一串字符串:");
scanf("%s",c1);
printf("请输入一串字符串:");
scanf("%s",c2);
p1=c1;
p2=c2;
mystrcat(p1,p2);
printf("输出拼接后的结果:%s",c1);
return 0;
}
void mystrcat(char *q1,char *q2)
{
char *t;
while(*q1!='\0')
{
*t=*q1;
q1++;
}
while(*q2!='\0')
{
*t=*q2;
t++;
q2++;
}
*t='\0';
q1=t;
}