I want to access members of a struct from double pointer but I get the error
"error: expected identifier before ‘(’ token"
:
struct test{
struct foo **val;
};
struct foo{
int a;
}
int main (){
struct test *ptr = (struct test *)malloc(sizeof(struct test));
ptr->val = &foo;
/*foo is already malloced and populated*/
printf ("Value of a is %d", ptr->(*val)->a);
}
I've also tried:
*ptr.(**foo).a