stringstream.good() > Different behaviour in VS and Eclipse compiler
I have some understanding problems regarding the stringstream.
Example:
stringstream stream(commands);
while (true) {
string line;
getline(stream, line);
if (!stream.good())
break;
if (line.size() > 0){
lines.push_back(line);
}
else{
break;
}
}
If I use this code in Eclipse it's no problem, it work as expected. Using this in Vistual Studio 2005 stream.good() seems to return always开发者_运维百科 false
why?
I would really appreciate some explanation.
To close this Question:
Like etarion said it's just a matter of the good()
method. Using some other mechanism works fine.
Thanks for your help!
精彩评论