Thread: Binary Tree and File I/O

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    9
    Quote Originally Posted by Matus View Post
    yea elsewhere, but that is the issue, remember the fucntion is recursive hence if i had "w" from teh start only the last entry would be written cause the file is overwritten. What i was asking was ok, i have the file written once, which is cool, but ok user goes says, hey i forgot to add another entry, user goes adds it, then choses write to file ok again, but what happens since its on a+ its added to the end, adn the file has duplicates now, and if "w" is used only the last entry is added. Umm makes sense?
    oh, I understand now! the problem is that you don't understand the concept,
    here:
    First you need to run the program in PURE memory, don't worry about files, If the user decides to save his/her data then write it to the file, this is ok the first time around, and like you said what if the user wants to add something or remove something from the file he/she saved, then simply LOAD the file, SCAN ALL DATA INTO MEMORY once more and now the user will be able to edit or do anything they want with the information and then simply write the data from memory to file again ( overwrite the file , hence "w" i said before ) and boom! there you have it done!

    regards

  2. #2
    POeT GuY Matus's Avatar
    Join Date
    Feb 2008
    Location
    Bz
    Posts
    235
    Yea guys no worries, got it solved, thanks to elsewhere
    PoEms R InsPiRatiOns of LIfE ExpErienCes!!


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Interpreter.c
    By moussa in forum C Programming
    Replies: 4
    Last Post: 05-28-2008, 05:59 PM
  2. please help with binary tree, urgent.
    By slickestting in forum C Programming
    Replies: 2
    Last Post: 07-22-2007, 07:55 PM
  3. Binary Tree, couple questions
    By scoobasean in forum C Programming
    Replies: 3
    Last Post: 03-12-2005, 09:09 PM
  4. read records fron file into a binary tree
    By Kirsten in forum C Programming
    Replies: 1
    Last Post: 04-23-2002, 02:48 PM
  5. BST/Red and Black Tree
    By ghettoman in forum C++ Programming
    Replies: 0
    Last Post: 10-24-2001, 10:45 PM