65,206
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
using namespace std;
char* strcpy_(char* strDest,const char* strSrc)
{
if (strDest==NULL || strSrc == NULL)
{
return 0;
}
char *strDestCopy = strDest;
while ((*strDest++ = *strSrc++) != '\0')
{
;
}
cout<<strSrc<<endl;// adf
cout<<strDestCopy<<endl;// 123
return strDestCopy;
}
int main()
{
char a[10]="adf";
strcpy_(a,"123");
return 0;
}