The Pets Project
Files:
- basics.h which defines the types
boolean and name_t. Note the
#ifndef...#endif wrapped around the body, to prevent it
from being #included more than once.
- cat.h which defines the
cat
struct type.
- fish.h which defines the
fish
struct type.
- dog.h which defines the
dog
struct type, and also provides a prototype for the
collect_bones function. Note that this, too, has an
#ifndef...#endif wrapped around it to prevent multiple
inclusion.
- dog.c which defines the
collect_bones function.
- pet.h defines the
pet_kind enum
and the pet struct. This could have had an
#ifndef...#endif wrapped around it; in this project, we
didn't need to, but it doesn't hurt, and might save a lot of trouble in
a future project.
- pet.c A main program and a pseudo-polymorphic
function on pets.
- MAKEFILE An ordinary text file specifying
dependencies among the files. For example,
pet.exe can't
be built until pet.obj and dog.obj exist and
are up to date; if one of them has changed recently, you need to
re-link.
Similarly, pet.obj needs to be rebuilt if any of
pet.c, pet.h, or dog.h has
changed recently.
Last modified:
Stephen Bloch / sbloch@adelphi.edu