C字符串復制。本站提示廣大學習愛好者:(C字符串復制)文章只能為提供參考,不一定能成為您想要的結果。以下是C字符串復制正文
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