I'm not completely sure but I think .hpp is where we use declare the the class and his member function and datas and in .cpp is where we define thoses member functions...my question is the nextif I declare a .cpp as .hpp something will happen??, could It work in the same way??
If I had any program where I fiend some .cpps and some .hpps what would happen if I changed all .cpps to .hpp less the main.cpp( It would keep that one with his original extension...??
ok, but in fact it's not important what each file contains......as long as the main declares at the begining each .hpp it will work, wont it??.or the main delcare a few .hpp and those one declared in the main declare the rest that complete the whole program. I hope It's understandable...
It would compile anything if you would be persistent enough.
Header files (those with extension .hpp) are not compiled. At all. All what they are good for is to copy-passte into actual implementation files. #include is a glorified copy-paste. THere is nothing magic in it. YOu can include anything: .hpp, .cpp, .txt, .exe... And its content would just be pasted inside your file which does inclusion.
I think I do...:), what I mean is, all the .cpp dont have to be declare in the main, if It's the just single one .cpp that I have...while the rest of the .hpp all declare in the ones are already declared in the main( always declaring in each .hpp what is nedded)
You're going down the wrong path. You don't want to do things that way.
.hpp and .cpp files have distinct purposes. .hpp files contain declarations, while .cpp files contain implementation of what is declared in the .hpp file. You don't want to put implementations in a .hpp file. Doing so can cause problems including multiply defined symbols or functions.