...
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 | ||||
---|---|---|---|---|
| ||||
#ifndef HEADER_H #define HEADER_H /* ... contents of <header.h> ... */ #endif /* HEADER_H */ |
...