Jump to content
  • Advertisement
Sign in to follow this  
Yamian

Making a Header

This topic is 5390 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

How do I make a header? I know you can just make functions in it, but what is with #ifdef and #endif and all that?

Share this post


Link to post
Share on other sites
Advertisement
The #ifdef and #endif are pre-processor directives. They can do all sorts of things in headers.

- Include different functions dependant upon OS etc
- Stop multiple inclusions

Share this post


Link to post
Share on other sites
its a rapper to make sure your code isnt called more then once in order to write a header file you just need to name it .h and include in it all the important libs you need. a header can be to a class or just for variable definitions
the most basic DOS header is:

#include <iostream>
#ifndef _MAIN_H_
#define _MAIN_H_
//put whatever in between here
#endif

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!