I\'m working on getting some legacy code under unit tests and sometimes the only way to sense an existing program behavior is from the console output.
I see lots of
You can use freopen(..., stdout) and then dump the file into memory or a std::string.
freopen(..., stdout)
std::string