Incard4.c from Chapter 10, Creating Custom Data Types with typedef, we saw a structure, Hand, that contains another structure, Card. However, in that program, we accessed the entire sub-structure. We assigned the hand.cardsub-structure by copying an entireCardstructure to it. While this is convenient if we are dealing with complete substructures, we also need to know how to access elements within the sub-structure of a structure.
Here, we are going to look at accessing sub-structure elements within a structure. Before we begin our exploration, copy the carddeck_1.cfiletocarddeck_2.c. Incarddeck_2.c, we'll add theHandstructure with sub-structures and operations onHand.