My case is somehow similar to stackoverflow.com/questions/16676973 however due to lack of knowledge I cannot learn the essential lesson from it...
What I want to achieve is loading constant image data into memory at compile time (without knowing size of each image exactly) and get an array of identifiers of each image so I can access them any time I wish within code. The ideal way would be an array of pointers to beginnings of each image, however then there is a question of how I could determine the exact size of each one later on. Would the sizeof(imagedatatype) change depending on i when I call images[i]... (I guess - no. Then how?)
How I'm trying to do this looks like this:
typedef struct _imagedatatype {
uint8_t imageId;
uint8_t dataofoneimage[]
} imagedatatype;
const imagedatatype images [] = {
{1,{A, ,L,O,T, ,O,F, ,C,O,N,V,E,R,T,E,D, ,I,M,A,G,E, ,D,A,T,A, ,I,N, ,H,E,X}},
{2,{A, ,L,O,T, ,O,F, ,C,O,N,V,E,R,T,E,D, ,I,M,A,G,E, ,D,A,T,A, ,I,N, ,H,E,X}}
//of course, data is fake here, just for illustration purposes, normally it is 0x00, 0x0c, etc
};
Of course, it throws error, something like "Too many initializers for array ...".
Taking it all short - I feel I have a lot of errors there, mainly ideological, but as I said I'm new to C so I'm trying to learn all those complex things quickly..
Please help.