c++ headers and classes
So suppose I have a big C++ program with a class called Hello.
Suppose furthermore that Hello has 3 methods foo(), bar(), asdf().
Now, my question what the usual way to store the classes is. Should Hello go in a file called Hello.hpp? Should the definitions of the methods also go in that file? Should they all be in a regular .cpp file?
Normally, the class definition would go into a header caller Hello.h (with appropriate include guards). Some people use .hpp instead of .h, so you could do that if you preferred.
That class definition would include the declarations of the three member functions.
The three member functions would be defined in Hello.cpp, which would #include "Hello.h".
Things might be different if you want an inline function or if you're using templates, but that's the basic idea.
The goal should always be to put as little in your header files as possible, only what must be shared with other source files. Keep what you can in the cpp file.
For one you reduce recompile times when you change something.