Lysator is generally confused about arrays -- consider the mess it makes of 2.14 which is a pointer into an array of int *, rather than being multidimensional.
Therefore array is an array of length 3 with an element type of int[4].
Note the single dimension used to access it here.
Of course, having accessed array[i], you can now access that one dimensional array via array[i][j], and so on.
Probably the easiest way to think about it is that C provides arrays of arrays, which is one way to implement multi-dimensional arrays, without any of the arrays actually being multi-dimensional.
it's all semantics there is no such thing as truly multidimensional arrays as all arrays are one dimensional
you can use a 2 or n dimensional accessor but that's about it.
there is no need to layer a simple thing to look complex.
Can you give me an academic resource to read it?
Also check this one lysator.liu.se/c/c-faq/c-2.html
Sure: open-std.org/jtc1/sc22/wg14/www/do... 6.5.2.1 Array subscripting
Lysator is generally confused about arrays -- consider the mess it makes of 2.14 which is a pointer into an array of int *, rather than being multidimensional.
The simplest proof is this.
Therefore array is an array of length 3 with an element type of int[4].
Note the single dimension used to access it here.
Of course, having accessed array[i], you can now access that one dimensional array via array[i][j], and so on.
Probably the easiest way to think about it is that C provides arrays of arrays, which is one way to implement multi-dimensional arrays, without any of the arrays actually being multi-dimensional.
it's all semantics there is no such thing as truly multidimensional arrays as all arrays are one dimensional
you can use a 2 or n dimensional accessor but that's about it.
there is no need to layer a simple thing to look complex.
There are such things are truly multi-dimensional arrays, just not in C.
For example, in pascal
Or in Common Lisp
This is not a criticism of C -- deciding to use arrays of arrays rather multi-dimensional arrays is a perfectly reasonable design choice.
It's just a design choice that should be understood clearly. :)