From: "Roberto Henríquez Laurent" Newsgroups: comp.os.linux.development.apps,comp.os.msdos.djgpp,comp.unix.programmer Subject: C++ Passing ostreams by reference to methods, problem Date: 28 May 1997 09:26:56 GMT Organization: Universidad de Castilla-La Mancha Message-ID: <01bc6b49$27fce100$1b2443a1@pcoec.uclm.es> NNTP-Posting-Host: 161.67.36.27 Lines: 43 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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!!! Thanks In Advance. Roberto. -- La neurona autora de este mensaje es propiedad de: +----------------------------------------+ | Roberto Henriquez Laurent | +----------------------------------------+ | shl24634 AT alumnos DOT inf-cr DOT uclm DOT es | +----------------------------------------+ ...y no se hace responsable de las opiniones vertidas por otras neuronas. ant against any change in that file, but that's Ok in many cases. I've compared BinPatch with GNU-Patch, MDiff and PatchMaker. The result were that BinPatch normaly has about 60% with some cases where it has only 20% filesize. BinPatch has been optimized for maximum packing efficiency and generates bigger patch files (as it needed to), but such who pack very good, gaining a lot compared the other patchers. Mls, Kay ## CrossPoint v3.11 R ##