Quote Originally Posted by Philip Nicoletti View Post
1) you need to open in :
Code:
ios::in | ios::out
2) Over-writing data in the middle of a file is done all the time.
It is simplest if the records are fixed length.

3) that being the case, you should also open in binary mode. ...

Code:
ios::in | ios::out | ios::binary
4) Normally, you would do unformatted I/O, not formatted I/O
Overwriting formatted data isn't the same as overwriting variable length data and inserting and deleting lines of text, which is what I assume the OP is talking about.