i have a project for my programming class where we have to create a binary search tree and then when the program exits we need to save the tree to a text file and then restore it when the program opens. the basic functions were given to us, but the textbook isnt clear on how to save and restore data to and from the text file. im just not sure where to put the code. would the restore code go in the trees constructor or do i need a seperate function to initialize all the nodes? also, because exit is a case statement, should i have the save function called in the case statement or after the loop finishes executing? any help would be appreciated, theres a lot of code which is why i didnt put it up, but i will if itll help
nightninja12 0 Newbie Poster
Tom Gunn 1,164 Practically a Master Poster
nightninja12 0 Newbie Poster
Lerner 582 Nearly a Posting Maven
nightninja12 0 Newbie Poster
Lerner 582 Nearly a Posting Maven
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.