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 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