Talk:cpp/io/basic istream/seekg

< Talk:cpp‎ | io

[edit] seekg and eofbit

This page tells that seekg clears eofbit, but I spent a lot of time seeking for an error. Result is next: if the flag eofbit was set, seekg can't do anything (but failbit was 0) and after calling seekg I got -1 from tellg. The solution was to call clear() before seekg to clear eofbit manually. I'm using gcc version 4.6.1. I don't know what standard says about this situation, but maybe this page should be corrected. -- 16:41, 11 March 2012 (PDT)

The standard seems to say that eofbit should be cleared -- section 18:08, 11 March 2012 (PDT)