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
type StatusType = (X, O, Blank); BoardType = array[1..3,1..3] of StatusType; var Board : BoardType; for count1 := 1 to 3 do for count2 := 1 to 3 do Board[count1, count2] := Blank;
Or in Common Lisp
(let ((a (make-array '(4 3)))) (aref a i j))
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. :)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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. :)