Hi !
I'm just learning how to use stringstreams. They seem to be powerful but they are confusing too. I want to be able to keep using the same stringstream object to handle conversions of different strings.
I currently have code that looks like this which works with 2 of the stringstreams but when I compile with all 3 stringstream objects i get a First-chance exception - Access violation in the memory and then a big crash. I think I understand the error I'm causing but I don't know how to fix it. Thanks !!!
ssStream << strPositionOne;
if( !(ssStream>> currentPositionOneInt).fail() )
{
//TODO: error check here..
// the stream is in a failed state at this point
// to reuse it, the failed state must be cleared first
ssStream.clear() ; // http://cplusplus.com/reference/iostream/ios/clear/
}