getline out of stringstream should not cut leading whitespace

Hi all,

I have a std::stringstream sstr I read data from with getline(sstr, s, ',').
Now I don't want it to cut off the leading blanks. How can I do that?

Thanks in advance
Lukas
Last edited on
std::getline() does not discard leading white space.
http://ideone.com/51ZG7d
Hi again,

I found it out, so in case anybody else is looking for it, here it is:
The stream needs to be fed with std::noskipws like this:
1
2
std::stringstream sstr;
sstr << std::noskipws;


HTH
Lukas
Topic archived. No new replies allowed.