SEARCH
TOOLBOX
LANGUAGES
modified on 14 August 2014 at 15:43 ••• 7,496 views

06-04 HeaderTemplate

From Manuals

Jump to: navigation, search

This example demonstrates the use of a header file and C/C++ preprocessor and preprocessor directives.

/* Program Example 6.4: Template for .h header file
                                                              */

#ifndef VARIABLE_H    // if VARIABLE_H has not previously been defined
#define VARIABLE_H    // define it now

// header declarations here…

#endif               // end of the if directive
 /* Program Example 6.4: main.cpp
                                                              */
#include "header.h"

main() {

}