不知为何加上一句srtcpy就出错!
#include<iostream>#include<cstring>
#include<string>
int main()
{
using namespace std;
char animal[20]="bear";
const char* bird="wren";
string name="aikun";
string name1;
char* ps;
cout<<animal<<" and "<<bird<<endl;
cout<<"Enter a kind of animal: "<<endl;
cin.get(animal,20).get();
ps=animal;
cout<<ps<<"s!\n";
name+=" 10000 years!";
strcpy(name1,name);
cout<<name<<endl;
return 0;
}