简单问题请教
copy函数中既有字符数组,又有整型,那么函数应该是什么类型呢?
{//此处不好对Copystr函数类型进行描述
int m;
char *str1[20],*str2[20];
printf("input \n");
gets(str1);
printf("which begin ?");
scanf("%d",&m);
if(strlen(str1)<m)
printf("input error");
else
{copystr(str1,str2,m);
printf("result:%s",str2);
}
copystr(char *p1,char *p2,int m)
{int n;
n=0;
while(n<m-1)
{n++;
p1++;
}
while(*p1!='\0')
{*p2=*p1;
p1++;
p2++;
}
*p2='\0';}
}