|
|
|
|
|
|
|
Figure 14-3
Array gradeBook with Records as Elements |
|
|
|
|
|
|
|
|
The following code fragment prints the first and last names of each student in the class: |
|
|
|
|
|
|
|
|
for (count = 0; count < length; count++)
cout << gradeBook[count].firstName <<
<< gradeBook[count].lastName << endl; |
|
|
|
|
|
|
|
|
We have seen examples where the components of a record are simple variables and arrays. A component of a record can also be another record. Records whose components are themselves records are called hierarchical records. |
|
|
|
|
|