From: "Campbell, Rolf [SKY:1U32:EXCH]" Newsgroups: comp.os.msdos.djgpp Subject: Re: EOF reading pascal binary file Date: Fri, 25 Jun 1999 12:04:25 -0400 Organization: Nortel Networks Lines: 20 Message-ID: <3773A888.2AA977AF@americasm01.nt.com> References: <37739D75 DOT 7473398A AT psy DOT kuleuven DOT ac DOT be> NNTP-Posting-Host: bmerhc00.ca.nortel.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.6 [en] (X11; I; HP-UX B.10.20 9000/712) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Peter Claessens wrote: > inversion). Does anyone know what is going on here? Are there any other > tricky details involved in reading pascal-generated files with a > c-compiled program? Is there an online source about these? > I'm using egcs 1.2. > > ifstream inpfile(cmdarglist[0].c_str(),ios::in||ios::binary); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You must use "|" between ios::in and ios::binary not "||". It is a bit-wise or'ing of their values, not a logical or'ing. Your call can only pass zero or one to the function. I suspect that the binary part is missing and it is truncating 13,10 to 10. -- -Rolf Campbell (39)3-6318