CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Threaded View

  1. #3
    Join Date
    Aug 2000
    Location
    West Virginia
    Posts
    7,725

    Re: fstream - Writing in the middle of a file

    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
    Last edited by Philip Nicoletti; September 10th, 2012 at 06:22 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured