Archived

This topic is now archived and is closed to further replies.

dre_gon

Question About Headers!

Recommended Posts

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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
actually it just a style.. that depends on the coder itself

make sure you put every code inside definition.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites