This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: seekg and eof


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]