Retrieving the address of a record in a text file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ahlam Hussain
    New Member
    • Oct 2011
    • 2

    Retrieving the address of a record in a text file

    Good Morning every one;

    I'm attending to apply indexes concept using c++ text files.

    I need to create two text files, one for index, the other for data records.

    I should insert/delete records to the text file according to physical address of the line, not to the number of the line in the text file.

    My problem is to get the address of the line I need to insert/delete from.

    Hope you understood me.
    any help !?
    Is there any body who knows how to retrieve the physical address of a text file line ??


    Thanks all.
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    What you want to do is use seek() ad tell() to get the locations in the file.

    You can insert and delete records based on how you created the file.

    I suggest you use a flat file until you master the mechanics if file management.

    Comment

    • Ahlam Hussain
      New Member
      • Oct 2011
      • 2

      #3
      Thenk you, I'll try using seek and tell.

      Thanks again

      Comment

      Working...