Chapter 16: Creating and Using More Complex Structures
In the real world, objects that we may want to model with data types and then manipulate with our program code are often best expressed as collections – sometimes complex collections – of the various data types we have already encountered. We saw how to make homogenous collections with arrays, where all of the values in the collection are of the same type and size. We also saw how to make heterogeneous collections with structures, where the various types in a structure are simple intrinsic types, even if they are not all the same type in the real world.
In this chapter, we will explore more complex structures. These include the following:
- Arrays of structures
- Structures consisting of arrays
- Structures consisting of other structures
- Structures consisting of arrays of structures
This may sound bewilderingly complex at first, but it is not. In reality, this is a logical extension of the...