|
-
September 10th, 2012, 07:08 AM
#4
Re: fstream - Writing in the middle of a file
 Originally Posted by Philip Nicoletti
1) you need to open in : 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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|