Mail Archives: djgpp/1997/02/20/15:34:32
In the vary near future I will be writing a funtion to write a set
of data to a binary file. This set of data will have pointers in
it pointing to other parts of the file.
Since the starting address of the block of data once it is loaded
into memory may change, I thought that the best way to store
this would be to subtract the starting address of the block from
each of my pointers before I store the data. Then, when I read
the file from the disk, I can add the address of whatever block
of memory I allocate to each of the pointers.
Is this the best / easiest / most ingenius approach I can use.
If you know of any other other approaches, please help me.
TIA
-Fwec
- Raw text -