程序代码:
#include<stdio.h>
char* mystrcat(char* a,char* b)
{
while(*a!='\0') a++;
while(*b!='\0')
{
*a=*b;
a++;
b++;
}
*a='\0';
return a;
}
int main()
{
char string[256]="abcd";
char string1[]="efgh";
mystrcat(string,string1);
printf("%s\n",string);
return 0;
}