Programming novice here. I\'m trying to allow a user to enter their name, firstName middleName lastName on one line in the console (ex. \"John Jane Doe\"). I want to make th
Use getline and then parse using a stringstream.
getline
stringstream
#include <sstream> string line; getline( cin, line ); istringstream parse( line ); string first, middle, last; parse >> first >> middle >> last; if ( last.empty() ) swap( middle, last );