Changes

Jump to: navigation, search

OOP344 - FjXR - 20102

673 bytes added, 15:37, 31 May 2010
no edit summary
(for either a member function or a regular function).<br/>
 
=== Include guards on header files ===
 
<p>Include guards are always used inside header files to prevent
multiple inclusion of a header file during the compilation of a
single .cpp file. The include guards are implemented using a
preprocessor #define and checking to see that a name hasn’t
already been defined. The name used for the guard is based on the
name of the header file, with all letters of the file name uppercase
and replacing the ‘.’ with an underscore. For example:</p><br/><br/>
 
 
<p>// IncludeGuard.h<br/>
'''#ifndef INCLUDEGUARD_H'''<br/>
'''#define INCLUDEGUARD_H'''<br/>
// Body of header file here...<br/>
'''#endif // INCLUDEGUARD_H'''<br/></p>
1
edit

Navigation menu