Multidimensional array and pointer arithmetic

int a[1][1];

a[0][0] = 1;

Why must I use the deference operator twice to get the value at a[0][0] (**a).

Why isn't it just *a like it is in a non multidimensional array?

Any help would be greatly appreciated!
It's the simple fact that *a == a[0]. It wouldn't make sense for *a to be both a[0] and a[0][0].

In any case, the general rule is *(a+i) == a[i] so if you want a[0][0], you'll need *(*(a+0)+0) or simply **a.
Last edited on
Thanks for the help!
Topic archived. No new replies allowed.