Alex, According to MSDN: "The freopen function closes the file currently associated with stream and reassigns stream to the file specified by path." That probably means that the original stdout (to which cout writes) has been closed, and so your cout output is getting lost in the big void... I know that you were probably expecting cout to get redirected to the file, but perhaps this just isn't the right way to do it (due to how cout is implemented in C++, etc.)... Good luck, Lyle -----Original Message----- From: gcc-help-owner@xxxxxxxxxxx [mailto:gcc-help-owner@xxxxxxxxxxx] On Behalf Of Alex Vinokur Hi, Where has output-to-cout gone in the program below?