I've got a library that is annoying me. When I command it to do what I need it to do, it spits out a bunch of text onto the screen that I don't need.
Is there a way to temporarily "mute" a console program, then re enable it later?
This is what I have found from Google:
std::streambuf* cout_sbuf = std::cout.rdbuf(); // save original sbuf
std::ofstream fout("/dev/null");
std::cout.rdbuf(fout.rdbuf()); // redirect 'cout' to a 'fout'
std::cout.rdbuf(cout_sbuf); // restore the original stream buffer
But that comes up with TONS of errors.
Any ideas? Thanks guys :)