Let's say I have
struct my_type_t {
int x;
int y;
int z;
};
struct my_array_t {
struct my_type_t test;
int otherstuff;
};
int main(void) {
struct my_array_t arrayofstructs[200];
somefunction(arrayofstructs);
return 0;
}
void somefunction(struct my_array_t *arrayofstructs, somevariable) {
for (int i; i < 200; i++) {
//Do stuff to
arrayofstructs->test[i].somevariable;
}
}
How can I pass in somevariable to tell the function to process that member (x, y, or z) of the array of structs?
Thanks!