280 pdfsam Cplusplus Primer Plus 4th Edition

This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks elem...

0 downloads 1 Views 170KB Size
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks

elements is an array of five integers. (See Figure 5.5.) You can think of the maxtemps array as representing four rows of five temperature values each.

Figure 5.5. An array of arrays.

The expression maxtemps[0] is the first element of the maxtemps array, hence

maxtemps[0] is itself an array of five ints. The first element of the maxtemps[0] array is maxtemps[0][0], and this element is a single int. Thus, you need to use two subscripts to access the int elements. You can think of the first subscript as representing the row and the second subscript as representing the column. (See Figure 5.6.)

Figure 5.6. Accessing array elements with subscripts.