实现字符串拷贝功能,写出函数原型和函数实现。strcpy函数
char string1[10];
char *p;
strcpy(string1,"1234567890");
char *p=0;
strcpy(string1,p);
char pstr[10];
pstr[0]='a';
p=strcpy(string1,pstr);
[解决办法]
char *strcpy(char *strDestination, const char *strSource) { assert(strDestination && strSource); char *strD=strDestination; while ((*strDestination++=*strSource++)!='\0') NULL; return strD; }