October 2004
Intermediate to advanced
240 pages
6h 22m
English
#include guards. Never write external #include guardsWear head(er) protection: Prevent unintended multiple inclusions by using #include guards with unique names for all of your header files.
Each header file should be guarded by an internal #include guard to avoid redefinitions in case it is included multiple times. For example, a header file foo.h should follow the general form:

Observe the following rules when defining include guards:
• Use a unique guard name: Make sure it is unique at least within your application. We used a popular convention above; the guard name can include the application ...