Alright, i'm in desperate help for a very simple problem...
I just finished a program that uses a file to keep track of records. One of the functions in my program loads each record from the file into a linked list and does all sorts of things to them. Long story short, once the function runs, i have a smaller version of the file in the linked list.
Now what i want to do is simple, take the stuff from the linked list and put them in the file... BUT how do i do that?
I thought of just going to the beginning of the file then sticking everything in, but considering this "new version" is shorter some of the previous stuff will remain at the end.
I then thought of going over the file and replacing everything with a blank space then added the new version at the beginning... it works... but i don't like the way i did it and its very unefficient...
So my question is... how can you clear a file? (If it is possible i don't mind deleting the file and creating another one with the same name... anything to get the file empty)
I'd appreciate your help... this damned thing is due tomorrow and i can't think anymore