So I’m chugging along in learning C++ and I’m starting to use Eclipse. As I create my .h files, I get this strange #define constant at the top:
#ifndef CLASSNAME_H_
#define CLASSNAME_H_
#endif /* CLASSNAME_H_ */
So, what gives? Am I supposed to use CLASSNAME_H_ for something?
(I should note that “classname” is just a filler. So, for example, my latest class was Person.h and I now have PERSON_H_)
This is a standard construct used to guard against re-inclusion of your header files, I think you are probably expected to rename CLASSNAME_H_ to something more unique.
or is your header file also called classname.h?
Edit: ok so I see now that classname wasn’t the actual value, but rather an example.
In that case, NO, you shouldn’t need to worry about this at all just ignore them and they will do their job.