rt谢谢!
谢谢斑竹不过我要的是new来的这片空间大小是动态的我输入多长的字符串都能存得下。这又怎么办呢 ?
#include <iostream>#include <string>using namespace std;int main(){ string name; getline(cin, name); cout<<\"You have typed: \"<<name<<endl; system(\"pause\"); return 0;}