I have several 450 element character arrays (storing bitmap data to display on lcd screens.) I would like to put them under a header file and #define
them, but
I have had a similar problem. In my case, I needed an array of constants in order to use as size of other static arrays. When I tried to use the
const int my_const_array[size] = {1, 2, 3, ... };
and then declare:
int my_static_array[my_const_array[0]];
I get an error from my compiler:
array bound is not an integer constant
So, finally I did the following (Maybe there are more elegant ways to do that):
#define element(n,d) ==(n) ? d :
#define my_const_array(i) (i) element(0,1) (i) element(1,2) (i) element(2,5) 0