Sign in to follow this  
freeworld

stringstream to string problems

Recommended Posts

freeworld    341
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this