Just as we extracted the typedef, enum, and struct instances, along with the functions for the Card structure, we will do the same for Hand structures, as follows:
- Create and open the hand.h header file and put in the following new lines:
#ifndef _HAND_H_
#define _HAND_H_
#endif
This is our starting point for this header file. Looking again through carddeck.c, we see that there are a couple of const int types related to Hand that we need to add as enum instances, as follows:
enum {
kCardsInHand = 5,
kNumHands = 4
};
- We can next add the typedef struct { … } Hand; declaration and the 4 function definitions related to the Hand structure: InitializeHand(), AddCardToHand(), PrintHand(), and PrintAllHands(). However, notice that a parameter to one of these functions is a Card* parameter, therefore the compiler will need to know about...