How can I have a user input spaces?

In c++, I want a user to be able to enter an entire phrase, spaces and all. I know using a string doesn't work. What would work?
string do work but with the aid of
getline
so if you do it like this.
1
2
3
4
string name; 
cout << "please enter your full name: \n"; // prompting the user //
getline (cin,name); // user input which is name //
cout << "welcome: " << name << endl;
// the output from the code //
Topic archived. No new replies allowed.