what is the purpose of header file

hie...what is the purpose of header file?
thank you.
Header files contain importan macros that are commonly used in most C/C++ programs. These macros define some important keywords and functions you may use throughout your program. For instance, you cannot use the cout or the puts or any of the standard input/output fnuctions without including the stdio.h or the iostream.h.
thanks ishe.....i got a new question....m_pConfig->SetLoadedEnv();......what does the '->' means??dont care about the m_pConfig and SetLoadedEnv....:)
Correction of Ishe:

1.
Header files contain declarations of functions and classes, in addition to occasionally preprocessor macros.

2.
You should not use <stdio.h> and <iostream.h> in C++, but instead <cstdio> and <iostream>
the "->" operator is basically analogous to the "." operator, except you use it on pointers to objects instead of objects. Both of them will access the public members of that object.

1
2
3
4
5
6
7
myObject foo;
foo.do_a_thing();
std::cout << foo.value;

myObject* bar = new myObject;
bar->do_a_thing();
std::cout << bar->value;


more on objects here:
http://www.cplusplus.com/doc/tutorial/classes.html
Topic archived. No new replies allowed.