I'm using the cerr stream for my error output, but I also wanted to save any of this error output in a stringstream in memory.
I'm looking to turn this:
stringstream errorString;
cerr << " Something went wrong ";
errorString << " Something went wrong ";
Into
myErr << " Something went wrong ";
Where myErr is an instance of a class that stores this in a stringstream and also outputs to cerr.
Thanks for any help.