Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

All these complications disappeared with the discovery of a simple technique: each header should #define a symbol that means "I have already been included." The entire header is then enclosed in an inclusion guard:

Code Block
bgColor#ccccFF
langc#ccccff
#ifndef HEADER_H
#define HEADER_H

/* ... contents of <header.h> ... */

#endif /* HEADER_H */

...