void mystrcpy(char *from, char *to)
{
for(; *from != ‘\0‘; from++, to++)
{
*to = *from;
}
*to = ‘\0‘;
return ;
}
void main()
{
char str1[]="abcd1234";
char str2[100]={0};
mystrcpy(str1, str2);
printf("%s\n", str2);
}
输出: abcd1234
原文:http://www.cnblogs.com/z360519549/p/6380332.html