Mail Archives: djgpp/1997/05/31/00:52:39
In article <01bc6b49$27fce100$1b2443a1 AT pcoec DOT uclm DOT es> "Roberto Henríquez Laurent" <shl24634 AT alumnos DOT inf-cr DOT uclm DOT es> writes:
>
> I'm trying to pass a stream to a method as a by-reference parameter so
>that this method could write info to it, in this way:
>
> i've got a class which defines one of its methods as this:
>
> void WriteYourInfo(ofstream &Dest)
> {
> Dest << "This is a test";
> }
>
> And I call the method like this:
>
>
> ofstream fout("myFile");
> .
> .
> .
> myObject.WriteYourInfo(fout);
> .
> .
> .
> fout.close()
>
> It works perfectly under MS-DOS, compiling with DJGPP. Under Linux the
>output goes to stdout instead of going to the file. Both versions of gcc
>are 2.7.2.
> What am I doing wrong? HELP!!!
Does fout get opened properly? Perhaps it doesn't and hence something
funky is happening?
- Greg
--
Comeau Computing, 91-34 120th Street, Richmond Hill, NY, 11418-3214
Producers of Comeau C++ 4.0 front-end pre-release
****WEB: http://www.comeaucomputing.com / Voice:718-945-0009 / Fax:718-441-2310
Here:comeau AT comeaucomputing DOT com / BIX:comeau or comeau AT bix DOT com / CIS:72331,3421
- Raw text -