Understanding two-dimensional arrays
A two-dimensional array is a familiar term; it's something like an Excel table, like the one shown in Figure 5.9.1. In Excel, for example, the address of the top-left cell is A1
. The address of the cell immediately to its right is B1
. Then the address of the cell immediately below A1
would be A2
, and that of the cell to its right would be B2
:

Figure 5.9.1: An Excel table is a two-dimensional array
In C#, as with other programming languages, things are a little different. The top-left cell has the address 0,0
and the address of the cell immediately to its right is 0,1
. The first number in 0,0
represents the row number; actually, the row index. So, row 1
means 0 index. The second number in 0,0
represents the column. In other words, the first column has an index of 0
. If you move over to the right, the 0
in 0,1
still represents the first row, which has an index of 0
, not 1
. And then the 1
in 0,1
represents the second column, which in Excel is called B
. Then...