This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: freopen & cout


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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]