Skip to main content
gamedev.net
🔒 Locked

Question About Headers!

Started by dre_gon 5 replies 200+ views
Original Post
dre_gon
dre_gon
Hi,i was just wondering why do people define name of the header file in the header file? For example. ZeldaBase.h #ifndef _ZELDABASE_H_ #define _ZELDABASE_H_ #endif
What This For?
dre_gon
dre_gon
Thank''s it''s sort of answers the question. But i still wonder why not say.

#define ZELDABASE.H not
#define _ZELDABASE_H_ what underscope stands for?
What This For?
feagle814
feagle814
I think they use underscores because some compilers may be picky about the names of #defined identifiers. The leading underscores may ensure that the name doesn''t clash with some other #definition that actually has a bearing on the program.
dre_gon
dre_gon
Thanks a lot fellows.
What This For?
jwace81
jwace81
They don''t define it like this:
#define ZELDABASE.H
Because the ''.'' is an operator, and so cannot be used in the name. However, you should be able to do this:
#define ZELDABASE_H and it should work just fine, since ''_'' can be used in a name.

J.W.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.