C++ examples for Preprocessor:Directive
#define a macro in your header file, and include only the contents of the header file if the macro hasn't been defined.
You can use this combination of the #ifndef, #define, and #endif preprocessor directives.
#ifndef MYCLASS_H__ // #include guards #define MYCLASS_H__ // Put everything here... #endif // MYCLASS_H__