不调用C++/C的字符串库函数,请编写函数strcpy
方案一
char *strcpy(char *strDest,const char *strSrc){ assert((strDest!=NULL)&&(strSrc!=NULL)); char *address=strDest; while((*strDest++=*strSrc++)!='\0'){NULL; } return address;}?
方案二
void stringcpy(char *to,const char *form){ assert(to!=NULL&&form!=NULL); while(*form!='\0') { *to++=*form++; } *to='\0';}?