You copied the Doc URL to your clipboard.
Guarding against multiple inclusion of header files
Guarding against multiple inclusion of header files has a number of benefits.
Specifically, guarding against multiple inclusion of header files:
Improves compilation time.
Reduces the size of object files generated using the
-g
compiler command-line option, which can speed up link time.Avoids compilation errors that arise from including the same code multiple times.
For example:
/* foo.h */ #ifndef FOO_H #define FOO_H 1 ... #endif /* bar.c */ #ifndef FOO_H #include "foo.h" #endif