I am stuck with how to access a 2-d array declared in a structure. For instance, I have declared a struct as follows:
Now in main function, how to access the variable 'a'? I tried the following
But, this program gives the following error:
error: expected identifier before ‘*’ token
Code:
struct sv { float a[10][10]; };
Code:
main () { struct sv * p; p = (struct sv *) malloc (sizeof(struct sv)); *(p->*(a+1)+1) = 20.0; printf("%f\n",*(p->*(a+1)+1)); }
error: expected identifier before ‘*’ token
Comment