Creating a multi-file program
We will take the final version of the carddeck.c
single-file program from Chapter 16, Creating and Using More Complex Structures, and reorganize it into multiple header files and source files. You may want to review the contents and organization of that file now before we begin.
We are going to create four .c
files, each with .h
files; we will create eight files in total. These files will be named as follows:
card.c
andcard.h
to manipulate theCard
structure.hand.c
andhand.h
to manipulate theHand
structure.deck.c
anddeck.h
to manipulate theDeck
structure.dealer.c
anddealer.h
to be the main program file;dealer.h
will be included in each of the source files when possible.
First, create a separate folder where these eight new files will exist...