5.1 The intention of header files

The intention of header files is to publish interfaces (common declarations) that should be made known to consumers. A header file usually includes one or more of the following components:

The most important thing to remember is that a header file should not include function definitions (with the curly braces), or variable definitions (without extern). Both function and variable definitions are stored in object files. If multiple files have definitions of the same name, the linker complains and no executable will be generated.

Copyright © 2006-09-07 by Tak Auyeung