it depends on compiler you use, with gcc const values go to code segment. with
codewarrior you can set it in project settings if it should be in data or in 
code

in both cases you must be careful to define const data in same segment as code
which is using them, otherwise application will crash. workaround for this is to
have two variables, 1 with const data and other one which is pointing to it and
assign it value once at beginning.

so you have

static const MyStruct data[..]={........};
const MyStruct **dataptr;

static void Startup()
{
        dataptr=data;
}

you call startup once and you use dataptr from now on...

also you must make sure that these data will fit into 64kb limit (one segment)

Luc Le Blanc wrote:
> I need to store a table of geodesic datum conversion factors (about 300 
> doubles.) If I put it in my code as a const struct, does it eat up my heap? 
> Or should I instead put the data into an auxiliary PDB I can read only when I 
> need to access the specific data I need?
> 
> 
> Luc Le Blanc
> 

-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to