std::getline (string) 继承于<string>
getline from stream into string
#include <iostream>
#include <string>
using namespace std;
int main(){
string name;
cout << "Please enter your name: "<< endl;
getline(cin, name);
cout << "Hello " << name << endl;
}
Extension: learn stringstream()
getline()
and struct
together
http://www.cplusplus.com/reference/string/string/getline/
深入理解stringstream: http://www.cplusplus.com/reference/sstream/stringstream/
深入理解sstream: http://www.cplusplus.com/reference/sstream/