delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/15/18:00:58

From: "Jonadab the Unsightly One" <jonadab AT zerospam DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: [gcc] fstream and non-textual data: EOF problem.
Date: 15 Sep 1998 21:22:19 GMT
Organization: Belly Laugh Software
Lines: 22
Message-ID: <01bde0ef$6015f820$LocalHost@jonadab>
References: <01bde0ea$cdbb1180$LocalHost AT jonadab>
NNTP-Posting-Host: craw-cas1-cs-31.dial.bright.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Jonadab the Unsightly One <jonadab AT zerospam DOT com> wrote in article 

Oh, one more relevant piece of info I left out:

> int main () 
> {
>      ifstream *infile;
> 
>      infile = new ifstream; infile->open("infile2.txt");

Changing this line (above) to
infile = new ifstream; infile->open("infile2.txt", ios::bin);
causes *every* character to be reported as -1,
right from the beginning.  Does that seem bizarre
to anyone else?

-- 
All my usenet posts are General Public License.

Dyslexic email address:  ten DOT thgirb AT badanoj


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019