Dear all,
I have a struct with many members (called struct X).
Now I want to use an integer (for e.g, int index) to index the struct.
For details,
Originally, we access the member of struct by using:
Now, I want to write a function like that:
Code:
void my_function (int index, void * output)
For example, I call:
Code:
my_function (1000, output)
This function will return the pointer of X.member1000 into the pointer output.
Can I do like this?
Is there the way to point to a member of struct? For e.g, can I use X.1000 (or something like this) to point to the 1000th member of struct X?
Any help is welcome