help with loop condition

This is a discussion on help with loop condition within the C++ Programming forums, part of the General Programming Boards category; can someone help me, this little demo program (to convert string to stream) seems to be stuck in the while ...

Im not sure because I dont use those functions, but an infinite loop could be caused if the getline function doesnt set the string 'temp' to "" when there is on more information in the stream, i.e. temp retains the value from the previous call. A possible remedy would be to test whether the stream itself is still valid. How about trying iss.eof(), iss.fail(), iss.good(), !iss -- whichever one works.