preprocessor
The C preprocessor is a separate language, run before the C compiler.
With it, one defines
- symbols whose values are strings
- macros, which replace a function-looking strings
- include outside files into current file
- conditionally cut out text based on value of a symbol
- replace defined symbols and macros
- concatenate strings
header files
A header file exists to communicate type information from one programming unit to anotherAlso used to for commonly-used preprocessor definitions
Unless you follow some method, header mayhem will result. I strongly recommend that each header
- include exactly the other headers needed to describe its contents
- have an include guard.
This way, the order of header inclusion doesn't matter, and small changes in headers are least likely to result in problems with other files.
An otherwise empty source file that just includes the header should compile.
Another option is for no header ever to include another.