PDA

View Full Version : #define MYCLASS_H ?



bnilsson
3rd February 2008, 10:25
In many of the Qt example headers it starts with something like this:


#ifndef MYCLASS_H
#define MYCLASS_H

#include ....

class myClass : public QSomeClass
{
...
};


What is the meaning and purpouse of the MYCLASS_H definitions?
I have noticed that it does not compile if they don't have the same name as the class in the file.

jpn
3rd February 2008, 10:50
See Wikipedia: Include guard (http://en.wikipedia.org/wiki/Include_guard)