Is it possible to increment through the fields of a structure using an index value.
If I had a structure like:
And say I wanted to populate the fields of the structure within a loop like:Code:typedef struct {
int field1;
int field2;
int field3;
} mystruct;
Code:mystruct aStruct;
for ( index = 0 ; index == 3; index++)
{
aStruct.index = 10;
}
Where index will refer to the field number in the structure?