#include<stdio.h>
char *mystrcpy(char *str, const char *ptr)
{
while((*str++ = *ptr++) != '\0');
return tmp;
}
{ char str[20] = "helloworld";
mystrcpy(str, ptr);
return 0;
}
用指针试写strcpy函数
最新推荐文章于 2023-07-20 21:26:59 发布
#include<stdio.h>
char *mystrcpy(char *str, const char *ptr)
{
while((*str++ = *ptr++) != '\0');
return tmp;
}
{ char str[20] = "helloworld";
mystrcpy(str, ptr);
return 0;
}