Going beyond 1D arrays to multi-dimensional arrays
It is common to present a two-dimensional (2D) array as an array of a 1D array. Likewise, a 3D array can be thought of as an array of 2D arrays. Furthermore, an N-dimensional array can be thought of as an array of (N – 1)-dimensional arrays.
This approach, while mathematically correct, may not provide a useful, working framework for multi-dimensional arrays. Therefore, before we can address the C syntax for declaring, initializing, and accessing multi-dimensional arrays, a proper conceptual framework must be developed. With that firmly understood, we can then delve into C's syntax for multi-dimensional arrays.
Revisiting 1D arrays
An array of one dimension is a block, or contiguous grouping, of a specified data type accessed via a base name; each element is then accessed via an offset from that base name. That offset is also called the index.
A 1D array may be called a vector in some domains, while in others...