[prev] [index] [next]

Multi-module C Programs

Large C programs are implemented as a collection of .c and .h files.

A pair of a.c and a.h generally defines a module:

  • a.c contains operations related to one particular kind of data/object
  • a.h exports definitions for types/operations defined in a.c
Why partition a program into modules at all?
  • as a principle of good design
  • to share development work in a large project
  • to create re-usable libraries