字符串拷贝记得strcpy
#include <iostream>
using namespace std;
int main()
{
char *p=new char[10];
// *p="zds" 错误
strcpy(p,"zds");
char *q=new char[10];
// q=p 错误
// *q=*p; 错误
strcpy(q,p);
cout<<p<<endl;
cout<<q<<endl;
return 0;
}
本文章转载请务必注明出处或保存此段。c++/lua/windows逆向交流群:69148232

浙公网安备 33010602011771号