Prevent multiple definitions in header files
When there definitions in a header file that can not be made twice, the code below should be used. A header file may be included twice other include files include it, or an included file includes it and the source file includes it again.
To prevent bad effects from a double include, it is common to surround the body in the include file with the following (where MYHEADER_H is replaced by a name that is appropriate for your program).
#ifndef MYHEADER_H #define MYHEADER_H // This will be seen by the compiler only once #endif /* MYHEADER_H */