tellg/tellp() can change state of stream ?

Paolo Carlini
Fri May 20 01:14:00 GMT 2005

Hi Canal, Vorfeed wrote:

>Zidrav 1.1 does not work with gcc 3.4.3 ...
>Since it's trivial program I tried to understand what goes on and reduced testcase to this:
The issue here is that tellg() (like seekg() and so on) basically do a
seek and a seek (or a flush) is generally needed to succesfully switch
from read to write (and viceversa). C++ openmode "in|out|trunc" means
"w+" in C terms (see and the C standard is very clear about
the above: see its (if you ask me, the C++ standard itself
maybe should be a little more explicit about those matters, agreed ;)


More information about the Libstdc++ mailing list