Jump to content
  • Advertisement
Sign in to follow this  
fuchu

Header files?

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

What are they exactly? How do I create them? In the asteroids game I downloaded it has alot of them in there. Do they matter? Do I need them? If I do, how do I make them? In DEVC++ all I can do is make source files, projects, resource files, and somehow templates.

Share this post


Link to post
Share on other sites
Advertisement
I'm not sure on the details myself, but I am pretty sure you name it as an .h file and include it in your current file then call any functions from it. A quick google search will get you on your way.

Share this post


Link to post
Share on other sites
Thanks. Sort of like Notepad .htm or .html
physics.h etc. Basically it is #define or something. I guess I will show an example and see if my mind can compile to a function from it. I f you could please tell me if it is right.
<table>
<td>
#ifndef PHYSICS
#define PHYSICS

/////////////////////
// CLASS DEPENDENCIES

class CPoly;
class CLink;

/////////////
// PROTOTYPES

void DoPhysics(CPoly *entity, int input);
CLink *FindCollision(CLink *currnode);

#endif
</td></table>
lets see,... Any idea on where I could call these

Share this post


Link to post
Share on other sites
I'm not sure if this works in Dev C++, but in Visual Studio when you enter the name for the file if you put .h as the extension while nameing it (must have extensions visible in windows) it will save it as a header. And yes they matter, they hold many of the functions and classes used by programs.

Share this post


Link to post
Share on other sites
*Forehead slap* What I meant before was that you can easily find answers like these in the first page of a google search. Sorry I can't personally help you.

Share this post


Link to post
Share on other sites
Np. It is ok. I will see in Dev really quick. If I can't do it then I will Limewire MS VisualStudio 2005. hehe. Thanks you P2P programs.

Share this post


Link to post
Share on other sites
You shouldn't have any trouble creating header files in dev-c++ since they're really important if you're programming in c or c++. Here's a link where you can read more about them: clicky. And instead of pirating a copy of Visual Studio you can download the free Visual C++ Express Edition Beta 2 here, which should be more than enough if you want to try Microsofts products.

Share this post


Link to post
Share on other sites
Quote:
Original post by Perost
You shouldn't have any trouble creating header files in dev-c++ since they're really important if you're programming in c or c++. Here's a link where you can read more about them: clicky. And instead of pirating a copy of Visual Studio you can download the free Visual C++ Express Edition Beta 2 here, which should be more than enough if you want to try Microsofts products.

Thanks. I will download that somewhere where they have Hispeed. Thanks.. Also umm... I found the header file thingy in dev. Thanks though.

Share this post


Link to post
Share on other sites
Quote:
Original post by fuchu
Np. It is ok. I will see in Dev really quick. If I can't do it then I will Limewire MS VisualStudio 2005. hehe. Thanks you P2P programs.


Not really. As a professional software developper, I don't thanks P2P programs - especially when they are used with piracy in mind. There are better - and more legal use for them, try to stick to these please.

Quote:
Original post by fuchu
What are they exactly? How do I create them? In the asteroids game I downloaded it has alot of them in there. Do they matter? Do I need them? If I do, how do I make them? In DEVC++ all I can do is make source files, projects, resource files, and somehow templates.


Now, a simple answer (thus not completely accurate) about your original question: header files are used to declare elements that will be defined in the implementation files (cpp). For example, you'll find the declration of class A in A.h, and the code for the different methods of class A in A.cpp.

Regards,

Share this post


Link to post
Share on other sites
Do a search for ADT's (Abstract Data Types) and look at documentation on C++ classes.

Header files are used primarily to accomplish information hiding. A very important aspect of ADTs and programming in general.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!