This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: seekg and eof
- To: martintrautmann at gmx dot de (Martin Trautmann)
- Subject: Re: seekg and eof
- From: Mike Harrold <mharrold at cas dot org>
- Date: Tue, 21 Dec 1999 13:34:19 -0500 (EST)
- Cc: gcc-bugs at gcc dot gnu dot org
>
> Hello,
>
> I don't know whether it is a bug or simply a mistake of me. When I have
> an ifstream and read it until the end the eof-flag is set. When I want
> to change the fileposition with seekg() this flag isn't reset. That
> means I get the right position with tellg() but I cannot read any more
> bytes with get(char).
> Are there any other possibilities to change the fileposition of an
> ifstream?
You have to clear the flag manually.
e.g.
fl.clear();
fl.seekg(0);
Regards,
/Mike