Home > DeveloperSection > Interviews > What You Should Include in a Header File ?

Posted on    March-28-2011 8:47 AM

 Visual C++ Visual C++ 
Ratings:
 1 Answer(s)
  1244  View(s)
Rate this:

Dependra Pathak
Dependra Pathak

Total Post:77

Points:385
Posted on    March-28-2011 12:00 AM

A header file should begin and end with #include guards to guarantee that it?s not #included more than once during the same compilation session. A typical #include guard looks as follows:
// from stdlib.h
#ifndef STDLIB_INCLUDED // included for the first time?
#define STDLIB_INCLUDED

Don't want to miss updates? Please click the below button!

Follow MindStick