Hey guys, I was just wondering why when dealing with a lot of classes do you often have to use something like the following code before the class:
#ifndef classCarhpp
#define classCarhpp and this code after the class
#endif Thanks in advance.
Hey guys, I was just wondering why when dealing with a lot of classes do you often have to use something like the following code before the class:
#ifndef classCarhpp
#define classCarhpp and this code after the class
#endif Thanks in advance.
Jump to Post— Stoned_coder 6That is called an inclusion guard. You put one in each header file you write. Its purpose is to stop the header file being included twice inadvertantly.
That is called an inclusion guard. You put one in each header file you write. Its purpose is to stop the header file being included twice inadvertantly.
Thanks guys. :)
It's amazing what your brain reads/thinks when you see a word that looks like another word...
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.