quote:Original post by johnnyBravo
so i guess i should just store things as strings then?
the thing is tho, i wouldnt be saving pointers, just classes and other data types.
i''d so rather do that, but i guess everyone is saying that is a bad idea.
But this program would probably only be used with ms vc++6 anyway...
But if you are saving classes with pointers to other classes, that''s a bad idea. Same thing as storing a linked list or an hash table just as they are on memory.
When i need to store stuff on a file which references other data i use ID''s to identify the diferent objects. The ID is the cell number of that object on the file. You can then later load the objects from the file and re-link them in memory.
I once made a nice generic memory manager for something like this. It was transparent to the user how the objects were saved and loaded. Probably it wasn''t very efficient but it worked.