www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/20/15:34:32

To: djgpp AT delorie DOT com
Subject: Storing pointers in a binary file
Message-ID: <19970220.152037.7567.2.fwec@juno.com>
From: fwec AT juno DOT com (Mark T Logan)
Date: Thu, 20 Feb 1997 15:14:52 EST

 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019