Header Files

This is a discussion on Header Files within the C++ Programming forums, part of the General Programming Boards category; I'm using Borland v.4.52. How do you make, include and use your own header files?...

This might seem a little confusing at first but basically this is just a simple class that your main.cpp file can use. Make sure you add the line

#include "Example.h"

to your main.cpp in the beginning. Using quotes as opposed to the brackets you are accustomed to means that it is a header file you defined and is located in the directory your source code is located in. Now if I wanted to declare an instance of this class in my main.cpp you would write it like this.

Code:

int main( void )
{
cExample cEx;
return ( 0 );
}

This would declare an instance of the class and you could access the public members as you normally would. Hopefully this helps you some.