From: collonelloNO_SPAM AT hotmail DOT com (Collonello) Newsgroups: comp.os.msdos.djgpp Subject: Re: djgpp: c++ and binary files Date: Sun, 07 Feb 1999 16:14:23 GMT Organization: SAUNALAHDEN SERVERIN asiakas Lines: 23 Message-ID: <36bdb8d4.1208723@news.dlc.fi> References: <36bc9292 DOT 14696703 AT news DOT dlc DOT fi> <36BD4842 DOT C71CB55E AT earthlink DOT net> NNTP-Posting-Host: mccx.rdyn.saunalahti.fi X-Newsreader: Forte Free Agent 1.11/32.235 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Sun, 07 Feb 1999 03:01:06 -0500, Martin Ambuhl wrote: >Collonello wrote: >> >> Okay, I've a problem. >> Somebody tell me what's wrong in this program: > >> ofstream fout("foo.dat", ios::binary); > ofstream fout("foo.dat", ios::out | ios::binary); > > >> ifstream fin("foo.dat", ios::binary); > ifstream fin("foo.dat", ios::in | ios::binary); >I cannot tell you for sure (so this may be wrong), but it seems that if >you use the mode argument at all, you must specify it completely. Yup. It worked. Thanks. To you and the other Martin. :) Funny but I actually took that part of the source code from Jesse Liberty's book, Teach yourself C++ programming in 21 days. -Tom