Any good sites of File Saving/ Loading
Hey everyone,
I''am trying to figure out how to save a linked list and man is it killing me. If anyone can tell me the source code or a good site on file saving and loading it would really help.
Stand Tall and Shake the Heavens!
Which bit are you finding hard?
I would do something like this:
open file
iterate through list
for each element
-write data fields to file
close file
to reload it:
open file
create element
read fields from file to element
add element to list
check for end of file
if yes - terminate list
if no - goto create element...
close file
-DeVore
I would do something like this:
open file
iterate through list
for each element
-write data fields to file
close file
to reload it:
open file
create element
read fields from file to element
add element to list
check for end of file
if yes - terminate list
if no - goto create element...
close file
-DeVore
It would also be wise to save the number of items, so that you don''t try to load in data that''s beyond the boundaries of the file. But yes, DeVore has it all written down.
For simple file i/o functions, look at fopen, fwrite, fread, and fclose in the MSDN.
For simple file i/o functions, look at fopen, fwrite, fread, and fclose in the MSDN.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement