How to check if stringstream>>string will put nothing on the string?
When you cannot read from stream - its state changes so when casting to bool will return false:
bool read = (ss >> laststring);
See ideone example
When you cannot read from stream - its state changes so when casting to bool will return false:
bool read = (ss >> laststring);
See ideone example