stringstream to string problems

Started by
1 comment, last by _goat 15 years, 6 months ago
I'm composing a stringstream from various bits of text with spaces between words. Then putting the stream into a string to be used. the problem is when putting the stream into the string it puts every up to the whitespace and stops.

stringstream ss;
string       str;

ss << "Here is some text";
ss >> str;

With this str becomes "Here", how do I put the whole contents in the stream into the string.
[ dev journal ]
[ current projects' videos ]
[ Zolo Project ]
I'm not mean, I just like to get to the point.
Advertisement
str = ss.str();
more information
Quote:Original post by Kambiz
str = ss.str();
more information


Just as a side-note, I find that website to be much less accurate than cppreference.
[ search: google ][ programming: msdn | boost | opengl ][ languages: nihongo ]

This topic is closed to new replies.

Advertisement