Summary
The array, the structure, and the pointer are three C++ compound types. The array can hold several values all of the same type in a single data object. By using an index, or subscript, you can access the individual elements in an array.
The structure can hold several values of different types in a single data object, and you can use the membership operator (.) to access individual members. The first step in using structures is creating a structure template defining what members the structure holds. The name, or tag, for this template then becomes a new type identifier. You then can declare structure variables of that type.
A union can hold a single value, but it can be of a variety of types, with the member name indicating which mode ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access