Accessing structure elements and sub-elements is a matter of layering access from the topmost, or outer structure elements, to the bottommost, or inner sub-structure elements. We have already seen simpler versions of this in the earlier sections of this chapter.
We must, however, be mindful of the data type of the sub-element being accessed. In particular, we must pay attention to whether the member element is a direct intrinsic type or structure or whether it is a pointer to another intrinsic type or structure. Being clear about differentiating member elements and pointer elements determines which notation is required—dot (.) or arrow (->) notation.
Given the preceding definition of Deck, consider the following access to each of its various elements and sub-elements:
Deck deck;
deck.cardsDealt = 0;
deck.bIsShuffled = false;
deck.shuffled[0] = NULL;
deck.ordered[3].suit = spade...