Hullo
Let's say I Initialise a struct with:
Code:
struct MyStruct
{
FLOAT A, B, C;
};
Now, when I initialise a variable, I can do:
Code:
MyStruct MyVariable[]=
{
{1, 2, 3}
{2, 6, 2}
//And so forth
};
What if though, I want to add another data set to the array? Right now MyVariable[0] and MyVariable[1] have info, but MyVariable[2] does not.
Do I have to do each component seperately?
I.e.
Code:
MyVariable[2].A = 4;
MyVariable[2].B = 1;
MyVariable[2].C = 0;
I've tried:
Code:
MyVariable[2]=
{
{4, 1, 0}
};
//Which gives me many errors about the {} brackets.
//I also tried:
MyVariable[2] = (4, 1, 0);
//Which tells me that the Binary "=" sign can't assign the floats (or something to that effect)
//I've also tried other combinations, but none have worked
So, I guess my question is, do I have to settle for that first one? Doing each element of the structure individually?