When a stream enters an error state (such as EOF), you need to reset
the error state before you can perform any further operations,
including seeking. Call clear() to completely reset the error state,
but you should check errors carefully - make sure badbit isn't set in
robust code, and be aware of the meaning of failbit.
C++ FAQ: http://www.yqcomputer.com/
C FAQ: http://www.yqcomputer.com/