Pointer dereference array index
问题 Having this: #include <stdio.h> #include <stdlib.h> struct Test { char c; } foo; int main (void) { struct Test **ar; ar=malloc(16); *(ar+1) = &foo; ar[1]->c = 'c'; //this work (*(*ar+1)).c = 'c'; //this does't work return 0; } //(**(ar+1)).c='c'; --> first case Why the above works only the variant with array entry and not pointer dereference? struct Test { char c; } foo; int main (void) { struct Test **ar; ar=malloc(16); *ar=malloc(0); *(ar+1) = &foo; //(**(ar+1)).c='c'; (*(*ar+1)).c='c'; //