[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CIncludeGuard
An implementation file (.c) does not have #include guards, because they do not get #included, but 'Added to Project' instead.
Always write internal #include guards. Never write external #include guards.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CIncludeGuard
(C) #include guard
This ?preprocessor statements #ifndef , ?#define and #endif can be used for #include guards. These prevent a header file (.h) to be #included multiple times, causing a redeclaration error.An #include guard
//Your header (.h) file
- ifndef __MYHEADERFILE_H
- define __MYHEADERFILE_H
- endif
An implementation file (.c) does not have #include guards, because they do not get #included, but 'Added to Project' instead.
Always write internal #include guards. Never write external #include guards.
'#include guard' links
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
