Mail Archives: djgpp/1997/02/16/22:05:18
>// 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 -