Tuesday, August 17, 2010

C++: Few misc notes on classes...

It's been a long time since I've posted about CPP - been busy with school
and learning new things. So, I'll take this time to go over few
miscellaneous notes on creating classes.

First, when you create the interface file (classname.h), you need to include
so-called "inclusion guards." These are actually commands to C++
Pre-Processor to not include the file again once the file has been created.
A typical inclusion guard goes like this:
#ifndef __classname_h__
#define __classname_h__
// The content of the header...

No comments:

Post a Comment