Archived

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

Question About Headers!

This topic is 5869 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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