Does anyone know were you can find documentation that tells the functions header files have and how to use them?
I've been Fiddling around with c++ and making several small useless programs, but need more help.
Header files
Header files
Last edited by jonas on Tue Nov 08, 2005 9:15 pm, edited 4 times in total.
Jonas
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
I don't know if you still need help w/ this or not.. But if you do:
It's pretty simple. Headers contain your function declarations, type definitions, and pre-processor directives. ie: You should declare all classes, variables, etc. in headers.. You should avoid using function definitions in headers to. If you need examples I can post.
I'm sure if you google it, you'll find plenty of resources and tuts.
It's pretty simple. Headers contain your function declarations, type definitions, and pre-processor directives. ie: You should declare all classes, variables, etc. in headers.. You should avoid using function definitions in headers to. If you need examples I can post.
I'm sure if you google it, you'll find plenty of resources and tuts.
Yes I would like any help I can get. Thanks for taking the time to even look at my post. I google it but I either skipped over the one's I needed or didn't go through enough pages to get to it.
It would help a lot if you could help me take a header file and decode it. Too see what functions it has.
Thanx in advance.
It would help a lot if you could help me take a header file and decode it. Too see what functions it has.
Thanx in advance.
Jonas
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
np,
If you have a header file already just post it and I will tell you what it does and how to use it. I looked for a good tut on google, and sadly they are all lacking good explanation.. I'll post some examples.
If you just need to use headers to declare functions and avoid classes it's extremely easy to do so:
simple.h
main.cpp
If you want to use classes, I always make a header file first and declare all classes and functions:
CSimple.h
Then I make a source file to host all definitions. ie: the logic of the program:
CSimple.cpp
Then I link to it in the main loop somewhere:
main.cpp
Hope this helps..
If you have a header file already just post it and I will tell you what it does and how to use it. I looked for a good tut on google, and sadly they are all lacking good explanation.. I'll post some examples.
If you just need to use headers to declare functions and avoid classes it's extremely easy to do so:
simple.h
Code: Select all
// Add preprocessor commands so this will only be defined once
#ifndef simple_h
#define simple_h
bool function();
#endif
Code: Select all
#include "simple.h"
// Main Loop
int main()
{
bool result = function();
return 0;
}
// Function Definition
bool function()
{
return true;
}
CSimple.h
Code: Select all
// Add preprocessor commands so this will only be defined once
#ifndef CSimple_h
#define CSimple_h
class CSimple
{
public:
function();
// Any public declarations go here
private:
// Any private declarations go here
protected:
// Any protected declarations go here
};
#endif
CSimple.cpp
Code: Select all
#include "CSimple.h"
bool function()
{
return true;
}
main.cpp
Code: Select all
#include "CSimple.h"
int main()
{
// Get Class and Function
CSimple simple;
bool result = simple.function();
return 0;
}
I don't have a specific one. I would like to learn the functions held with in a dev-cpp header, that is for creating sockets and connecting to IP address's. If I can learn about that I would like to help with RF multiplayer. I will have to post the file from my other computer onless you have one. And that is if you even want to take the time to explain it!
Jonas
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
this might help, i dont know what skill level you are with c++, but this is a complete book on it free. http://www.mindview.net/Books/TICPP/Thi ... CPP2e.html
I've allready got that one but thanks I'm sure that one will come in handy for a lot of other people. I like how it explains everything as objects. Makes it easier to think thru your program. I haven't finished all of it, yet because its so long.
Jonas
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack