Because I\'ve made .cpp files then transfered them into .h files, the only difference I can find is that you can\'t #include .cpp files. Is there any difference that I am m
The .cpp file is the compilation unit : it's the real source code file that will be compiled (in C++).
The .h (header) files are files that will be virtually copy/pasted in the .cpp files where the #include precompiler instruction appears. Once the headers code is inserted in the .cpp code, the compilation of the .cpp can start.
Others have already offered good explanations, but I thought I should clarify the differences between the various extensions:
Source Files for C: .c Header Files for C: .h Source Files for C++: .cpp Header Files for C++: .hpp
Of course, as it has already been pointed out, these are just conventions. The compiler doesn't actually pay any attention to them - it's purely for the benefit of the coder.