1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #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; } |