March 2010
Beginner
760 pages
18h 51m
English
Another major composite data structure is the Pascal record or C/C++/C# structure.[65] The Pascal terminology is probably better, because it tends to avoid confusion with the more general term data structure. Because HLA uses the term record, we'll adopt that term here.
Whereas an array is homogeneous, whose elements are all the same type, the elements in a record can have different types. Arrays let you select a particular element via an integer index. With records, you must select an element (known as a field) by name.
The whole purpose of a record is to let you encapsulate different, though logically related, data into a single package. The Pascal record declaration for a student is a typical example:
student = record Name: string[64]; ...