the title pretty much says it all i have a struct with an array of struct as one of its member and I can't figure out how to access
struct Member{
short x;
...
};
struct List{
struct Member members[MAX_MEMBER];
...
};
short function(const struct List*n){
if((n->members[i])->x ...)
...
}
I tried somethin like that but it doesn't work. Thanks for your answer
.xinstead of->x.n->members[i]is astruct Member, so you don't need the pointer arrow notation. And the parentheses are unnecessary too. If you're perverse enough, you could use(&n->members[i])->x, but that is silly.