Possible Duplicate:
What is the purpose of forward declaration?
Forward Declaration vs Include
i am a bit confused with the #include *.h
file inclusion in both the header and cpp files. I see that some .h files are included in the header file and some in the corresponding cpp file. I would guess that all needed .h files would need to be included in the header file and thus do not see a reason why they have been included in the cpp file. Is there any specific reason for this?
Also, I see that some needed classes have been included in the header file using Class ClassName;
. How is this different from just including the ClassName.h
in the header file?