When creating a struct and initializing it like so in file foo.h:
struct t_foo{int a, int b}foo{1, 2};
And then using it in another file foomap.h:
(addr is implemented as #define addrX VAL )
struct foomap_item
{
int addr
int read;
int write;
}
struct foomap_item foomap[]{
{addr1, foo.a, 0 },
{addr2, 0, foo.b }
}
I get an error "Initializiner element is not constant", because fields in my struct foo is not actually a constant. The point of this is to initialize "map" and have the ability to change fields in my foomap (read and write).
I believe that something like two or three additional hashmaps will work but I don't understand which variable and where put on right now.