Going through knr and i've reached multidimensional arrays.
I'm wondering about a couple things:
First.
Suppose i initialize the following array
int a[2][4] = {{1,2,3},{4,5,6}};
Now, i understand this as setting aside 2 blocks of 4*sizeof(int) bytes of contiguous memory. Alright, so then it seems to me like its just a nice way to set aside memory defined multiplicativly. So... Why is the following not true:
int a[8] == int[2][4]
Second, when i go,
int a[2][3] = {{1,2,3},{2,3,4}};
Why does this attempt fail
a[5] = 22;
So what IS a multidimensional array if its not just a contiguous block of memory?