M
mike.arsenault
I'm not sure how to explain this problem other that posting the code
that I'm attempting to compile, so here it is:
struct innerStruct
{
int m_RelOID;
int m_ParentClassOID;
int m_InverseRelOID;
int m_InverseParentClassOID;
};
struct outerStruct
{
int m_HashIndex;
struct innerStruct m_InnerArray[];
}
s_OuterStruct[] =
{
0, {
{1, 2, 3, 4},
{5, 6, 7, 8}
},
1, {
{11, 12, 13, 14},
{15, 16, 17, 18},
{25, 26, 27, 28},
}
};
's_OuterStruct' is an array of structs - I'm trying to initialize an
array with 2 elements in it.
The first element has a '0' with an 'inner' array of 2 elements
(of type 'innerStruct').
The second element has a '1' with an 'inner' array of 3 elements
(of type 'innerStruct').
I'm having a hard time coming up with the proper syntax to initialize
this 'array of structs, each of which is composed of a number and
another array of structs'.
Keep in mind that the inner 'array of structs' won't have the same
number of elements, as in the above example.
Is what I'm trying to do even possible with static initialization??
Thanks
Mike
that I'm attempting to compile, so here it is:
struct innerStruct
{
int m_RelOID;
int m_ParentClassOID;
int m_InverseRelOID;
int m_InverseParentClassOID;
};
struct outerStruct
{
int m_HashIndex;
struct innerStruct m_InnerArray[];
}
s_OuterStruct[] =
{
0, {
{1, 2, 3, 4},
{5, 6, 7, 8}
},
1, {
{11, 12, 13, 14},
{15, 16, 17, 18},
{25, 26, 27, 28},
}
};
's_OuterStruct' is an array of structs - I'm trying to initialize an
array with 2 elements in it.
The first element has a '0' with an 'inner' array of 2 elements
(of type 'innerStruct').
The second element has a '1' with an 'inner' array of 3 elements
(of type 'innerStruct').
I'm having a hard time coming up with the proper syntax to initialize
this 'array of structs, each of which is composed of a number and
another array of structs'.
Keep in mind that the inner 'array of structs' won't have the same
number of elements, as in the above example.
Is what I'm trying to do even possible with static initialization??
Thanks
Mike