#include <stdio.h>
void copystr(char *from,char *to)
{
int i;
for(i=0;*(from+i)!='\0';i++)
*(to+i)=*(from+i);
*(to+i)='\0';
for(i=0;*(to+i)!='\0';i++)
printf("%c",*(to+i));
}
void main()
{
char *a="I am a boy.",*b="you are a bitch.";
copystr(a,b);
}
添加了两个void ,运行通过
void copystr(char *from,char *to)
{
int i;
for(i=0;*(from+i)!='\0';i++)
*(to+i)=*(from+i);
*(to+i)='\0';
for(i=0;*(to+i)!='\0';i++)
printf("%c",*(to+i));
}
void main()
{
char *a="I am a boy.",*b="you are a bitch.";
copystr(a,b);
}
添加了两个void ,运行通过