I need to write all my program output to a text file. I believe it\'s done this way,
sOutFile << stdout;
where sOutFile is the ofstr
Then you cannot use std::cout anywhere else to print stuff from your program. Change std::cout to a std::ostream and then pass your file or std::cout as required.