Multi-Dimensional Arrays, pg.198
I thought I understood arrays until I read your example on pg. 198.
It's a four by eight array, so why wouldn't it be:
int[ , ] values = new int[4, 8];
values[0, 0] = 0 * 0;
...
values[3, 7] = 3 * 7;
that is, the array is initialized to 4 x 8 (4 rows, 8 columns) not [5, 7] as shown in the text, and
the last "box" is values[3, 7] not values[4, 7] as in the text.
and the last box holds the results of 3 * 7, not 4 * 7 ...
|