Given the following code:
struct BufferPair
{
ByteBuffer _a;
ByteBuffer _b;
bool _c;
};
struct TestData
{
MyClass _myClass;
BufferPair _data[];
};
I'm trying to initialize an array of TestData where I also initialize an array of BufferPair. Each instance of TestData will have a differently sized BufferPair array. Simplified Example:
const TestData g_Data[] = { MyClass(), { { bufOne, bufTwo, someBool }, { bufThree, bufFour, anotherBool } } };
While trying this, I get the following gcc error:
error: too many initializers for 'BufferPair [0]'.
How would I solve this? Thanks.