The code cin >> y; only reads in one word, not the whole line. To get a line, use:
string response;
getline(cin, response);
Then response will contain the contents of the entire line.
The code cin >> y; only reads in one word, not the whole line. To get a line, use:
string response;
getline(cin, response);
Then response will contain the contents of the entire line.