I wanted to experiment with stringstream for an assignment, but I'm a little confused on how it works. I did a quick search but couldn't find anything that would answer my question.
Say I have a stream with a dynamic size, how would I know when to stop writing to the variable?
string var = "2 ++ asdf 3 * c";
stringstream ss;
ss << var;
while(ss){
ss >> var;
cout << var << endl;
}
and my output would be:
2
++
asdf
3
*
c
c
I'm not sure why I get that extra 'c' at the end, especially since _M_in_cur = 0x1001000d7 ""