1,不用库函数实现strcpy,并说明strcpy返回char*的原因
为了实现链式表达式。 例如 int length = strlen( strcpy( strDest, “hello world”) );
/*将字符串s1复制到s2*/char* mystrcpy(char *s1, const char *s2) { if(s1==NULL || s2==NULL) return -1; char *r=s1; while((*s1++ = *s2++) != '