www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/16/22:05:18

From: billlanam AT california DOT com (Bill Lanam)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: tellg problem
Date: Mon, 10 Feb 1997 21:07:11 GMT
Message-ID: <32ff866a.8456967@seashell.california.com>
References: <5dn8rt$scs AT lion DOT cs DOT latrobe DOT edu DOT au>
NNTP-Posting-Host: 140.174.210.251
Lines: 29
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

>// Reads in the list of suburbs and streets from the file.
>void SuburbListC::Get()
>{
>  static StringC EOL,MainDir=Config->GetMainDir();
>  int I;
>
>  File.open(MainDir+"streets.dat",ios::in);
>  if (!File)
>    Error->ErrorMessage(NoFile,MainDir+"streets.dat");
>  else
>  {
>    File>>NumSuburbs>>EOL;
>    SuburbList=new SuburbC[NumSuburbs];
>    for (I=0;I<NumSuburbs;I++)
>      SuburbList[I].Get(File);
>  }
>  File.close();
>}
>
>
>A problem occurs in the call to tellg (marked with stars).
>
>The two variables Name and NumStreets are read from the file correctly
>however after the call to tellg the file pointer is moved further on in
>the file.
>
I believe that tellg is only accurate when the file is opened in binary mode.

    Bill Lanam

- Raw text -


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