回复 10楼 yangang2
提示: 作者被禁止或删除 内容自动屏蔽
#include <iostream> using std::cout; using std::endl; char *strcpy(char* strDest ,const char* strSrc); int main () { char adress[ ]="String Copy"; char Dst [ ]="Why fdfefdsfefsdf"; cout<<strcpy(Dst,adress)<<endl; system ("Pause"); return 0; } char *strcpy(char* strDest ,const char* strSrc) { if ( *strDest == NULL || *strSrc == NULL ) { cout<<"strDest == NULL || strSrc == NULL"<<endl; } while ( (*strDest++ = *strSrc++ ) != '\0' ) { ; } return strDest; }主要原因是目标字符串的长度没有源字符串的长.....