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.
Originally, we access the member of struct by using:
Now, I want to write a function like that:Code:X.member1000
For example, I call:Code:void my_function (int index, void * output)
This function will return the pointer of X.member1000 into the pointer output.Code:my_function (1000, 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