char *strcpy(char *dest, const char *src)
{
char *tmp= dest;
while ((*tmp++ = *src++) != ‘\0’)
return dest;
}
/* 简单一点可以把while改成 */
while(*src!='\0')
{
*tmp = *src;
tmp++;
src++;
}
char strcpy(char *dest,char *src)
{
char xxx[strlen(dest)];
char yyy[strlen(src)];
init(xxx);
init(yyy);
sprintf(xxx,"%s",dest);
sprintf(yyy,"%s",src);
sprintf(xxx,"%s",yyy);
return xxx;
}
o(∩_∩)o...