I was beginning to make a text based game when I couldn't even make a user input a full name. It has really got me confused, unfortunitly and sadly I cannot get it to work.
#include <iostream>
#include <string>
usingnamespace std;
int main()
{
cout << "Your name: ";
string Name;
cin >> Name;
cout << "Your name is " << Name << endl;
return 0;
}
I just want a user to be able to enter any kind of name. But as i was testing the program, I noticed that when you type a long name like Henry John Finch, the output says Your name is Henry. The program ignores everything after the space and have no idea on how to fix this problem.