I have a string object and an istringstream object and I was wondering if it was possible to set the string data in the stringstream using a member function.
I know you can initialize an istringstream like this:
But I wasn't able to find a straightforward way to recycle the stringstream with a member function. The only way I was able to think of was:
It works, but I have a feeling there's a better way to do it. But how?
somestream = new istringstream(somestring);
//do something with the stream
somestream = new istringstream(someotherstring);
//do something else with the stream