This is not a compiler error. tellg() not guaranteed to return an offset from the beginning of the file. There is a minimal set of guarantees, such as if the return value from tellg() is passed to seekg() , the file pointer will be located at the corresponding point in the file.
In practice, unix tellg() returns the offset from the beginning of the file. In windows, it returns the offset from the beginning of the file, but only if the file is opened in binary mode.
But the only real guarantee is that different values ββreturned from tellg() will correspond to different positions in the file.
Peter source share