Deletion In Files Hendeling In C++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pankaj255143
    New Member
    • Oct 2007
    • 17

    Deletion In Files Hendeling In C++

    How can i delete an object which stored at 24th location. and the size of each object is 12. and total size of file is 48.
    plz give me the function or code by which i can delete that object whithout affecting other elments.
  • hanaa
    New Member
    • Nov 2007
    • 44

    #2
    I think, one leaves the element tht is to be deleted and copies the rest into a new file. Then you delete old file and rename the new file with the old file's name. Tht's wht i did, in a miniproject.
    But there could be better options. I think you should wait for another solution

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      Usually you overwrite the record to be deleted by charaters not likely to be valid data characters, like 032. And that's all you do.

      Later you can run a reformat utility that will copy the file skipping the delete characters.

      Comment

      • pankaj255143
        New Member
        • Oct 2007
        • 17

        #4
        my problem is solved
        thanks

        Comment

        Working...