You can have arrays in multiple dimensions:
The comma separates the dimensions, and referring to the array would be done with:
Two-dimensional arrays are useful for programming board games. A tic tac toe board could have these type and variable declarations:
You could initialize the board with:
You can, of course, use three- or higher-dimensional arrays.
<<< Previous | Table of Contents | Next >>> |