Question about string and getline
Is there a way to use getline to take a series of strings and put them into three different string values? For example:
1 2
|
cout << "Please enter your full name: ";
getline( cin, first, middle, last);
|
Obviously this is wrong, I know I have to manipulate the entered text somehow to put them into their respective strings.
Or would it be easier to ask for each part individually?
Last edited on
1 2 3
|
std::cout << "Please enter your first, middle, and"
"last name, separated by spaces: " << std::flush;
std::cin >> first >> middle >> last;
|
Topic archived. No new replies allowed.