Multidimensional Arrays
The types of arrays you’ve seen thus far are all linear arrays; that is, they all deal with a single dimension. The language enables you to define arrays of any dimension. This section takes a look at two-dimensional arrays.
One of the most natural applications for a two-dimensional array arises in the case of a matrix. Consider the 4 × 5 matrix shown here:
10 5 –3 17 82
9 0 0 8 –7
32 20 1 0 14
0 0 8 7 6
In mathematics, an element of a matrix commonly is referred to by using a double subscript. If the preceding matrix were called M, the notation Mi,j would refer to the element ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access