【请教】 这两句话为什么不能换
#include<iostream>#include<string>
int main()
{
using namespace std;
char animal[20]="bear";
const char* bird="wren";
char* ps;
cout<<animal<<" and ";
cout<<bird<<"\n";
cout<<"Enter a kind of animal:";
cin>>animal;
ps=animal;
cout<<ps<<"s!\n";
cout<<"before using strgy():\n";
cout<<animal<<"at"<<(int*)animal<<endl;
cout<<ps<<"at"<<(int*)ps<<endl;
ps=new char[strlen(animal)+1];//此处为什么不能用 ps=animal;代替
strcpy(ps,animal);
cout<<"after using strcpy():\n";
cout<<animal<<"at"<<(int *)animal<<endl;
cout<<ps<<"at"<<(int *)ps<<endl;
delete[]ps;
return 0;
}