Your code looks fine (aside from using raw walues insted of named constants in seekg, but if you are using GCC 4.9.x those values are correct).
So potential possibilities are:
* There is a problem in your code either before or after, therefore I need complete compiling example which actually has a problem to actually test it and check what the problem might be.
* There is a problem in input file: easy to check, just need to see file itself. Doubles as input to test (1).
* Something other. To quickly eliminate most potential problems: use beg/end constants in seekg, check stream state before each operation (if failbit is set operation will fail), and check gcount after read to ensure that characters were extracted.
I'm partially right, partially wrong. Even the code is mostly understandable only constructor for "f" is missing. But whatever makes you happy i'm sorry.