Chapter 12: Working with Multi-Dimensional Arrays
Chapter 11, Working with Arrays, is essential for understanding the concepts presented in this chapter. Please read through and ensure you understand that chapter before reading this one.
In Chapter 11, Working with Arrays, we explored a one-dimensional (1D) array, where an array is a contiguous group of the same data type accessed via a base name and an index. In this chapter, we will extend the concept of arrays from one dimension to many dimensions. Multi-dimensional arrays occur in a myriad of objects that we deal with in daily life—from a simple checkers board or chessboard, a multiplication table, or the pixels on a screen to more complex three-dimensional (3D) objects, such as volumetric spaces. We will see that these are simple extensions of 1D arrays.
The following topics will be covered in this chapter:
- Going beyond 1D arrays to multi-dimensional arrays
- Declaring and initializing multi-dimensional...