Use file pointer manipulation functions:
seekg(), seekp(), tellg(), tellp()...
seekg() and seekp() are used to change the position of the file pointer where the position is given as byte number in braces as parameter...
tellg() and tellp() are used to get the pointer position in bytes...
Cheers...