I am using a stringstream, but when I try to read out items into a string, it reads in by line not ' ' delim as I expect the behaviour to be.
stringstream ss;
string inputBuffer, stringBuffer;
getline(cin, stringBuffer);
ss << stringBuffer << '\n';
ss >> inputBuffer;
If stringBuffer is "This is a string", my inputBuffer gets "This is a string" not "This" as I expect.
stringstream ss;
string inputBuffer, stringBuffer;
getline(cin, stringBuffer);
ss << stringBuffer << '\n';
ss >> inputBuffer;
If stringBuffer is "This is a string", my inputBuffer gets "This is a string" not "This" as I expect.
Comment