struct A
{
int member1;
int member2;
struct B
{
int member3;
int member4;
} *b;
};
How can I initialize A and at the same time create an array of B's to fill the b field? I want a static variable, so preferably function calling.
I tried this but it does not work (I didn't think it would):
static A a = {
1,
2,
& { {3, 4}, {5, 6} },
}
[c++]and[c]tags are not synonymous; the answers will vary depending on the language.bfield" is not an array and cannot be "filled". Pointers and arrays are not in any sense the same.