D
DCSudolcan
I know that a program can create and properly initialize an array of pointers
to functions at build time, but can something like the following be done at
build time?
void foo(void);
unsigned char myArray[]={
(unsigned char) (foo&0xFF),
(unsigned char) ((foo&0xFF00)>>8),
(unsigned char) ((foo&0xFF0000)>>16),
(unsigned char) ((foo&0xFF000000)>>24),
0x00, // other data...
0x01, // other data...
0x02, // other data...
0x03, // other data...
0x04 // other data...
};
My goal is to be able to initialize an array at build time with a variety of
instances of a variety of differently sized data values, including pointers to
functions encoded as arrays of bytes. Is it possible to do this (and get valid
results)? Or, is there no way for compilers to resolve this type of problem.
Confuzed...
Dave.
to functions at build time, but can something like the following be done at
build time?
void foo(void);
unsigned char myArray[]={
(unsigned char) (foo&0xFF),
(unsigned char) ((foo&0xFF00)>>8),
(unsigned char) ((foo&0xFF0000)>>16),
(unsigned char) ((foo&0xFF000000)>>24),
0x00, // other data...
0x01, // other data...
0x02, // other data...
0x03, // other data...
0x04 // other data...
};
My goal is to be able to initialize an array at build time with a variety of
instances of a variety of differently sized data values, including pointers to
functions encoded as arrays of bytes. Is it possible to do this (and get valid
results)? Or, is there no way for compilers to resolve this type of problem.
Confuzed...
Dave.