View Full Version: about header files

C++ Learning Community > C++ Help > about header files


Title: about header files
Description: what EXACTLY do they do?


ih8censorship - July 2, 2003 02:42 AM (GMT)
well i was wondering about header files and i know you have to include them if you want to use some functions, but i opened them in dev c++ and all i can see is like #define something and a bunch of function prototypes. do header files do more than just provide function prototypes? what does #define do? before i opened it i expected to see more advanced c++ code like a library of code or something but it was different than what i thought.

Shadow of the Moon - July 2, 2003 03:03 PM (GMT)
The #define declares a macro. The ones like that are most likely wrappers and stuff so that you can use easy to understand code that does hard to understand stuff. Most of the time there is advanced code deep down in there, though sometimes you have to go through a series of #includes to find it.

You can include anything as a header file. I like to set up my classes in another file and just include it.

Dragon - July 2, 2003 04:11 PM (GMT)
Header files can be any file that you want to include in your program. Instead of using standard headers you can create your own, say 'MyHeader.h', then in your program, you can write '#include "MyHeader.h"'. For your own headers, you use quotes around the name of the file, not "<>".




* Hosted for free by InvisionFree