freopen & cout

lrtaylor@micron.com lrtaylor@micron.com
Tue Dec 2 18:48:00 GMT 2003


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@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Alex Vinokur

Hi,

Where has output-to-cout gone in the program below?



More information about the Gcc-help mailing list