I am trying to create an array of const structs, but i Keep getting
error initializer element is not a compile time constant
I am using keil IDE. this is strange because my struct is a const, here is an example:
typedef const struct{
CRGB color; // CRGB is another struct
void (*myfunc)(int);
}myProfile;
myProfile profile1 = { ....... }; // initialized struct
myProfile profiles[1] = { profile1 }; // error occurs here
even if I use
const myProfile profile1 = { ..... };
to initialize the struct, i still get the same errors.
I can find my way around it but I really want to understand what is going on. Thanks.