I have a "style" question concerning building bigger programs. I am working on a project that I expect to grow slowly over a couple of years, so I've started distributing the code over several files to make it all easier to track. My question is in regards to the proper way to handle "class declarations"?
I tried putting the classes in ".cpp" files, but when I run make, it complains. From reading various forums it seems that header files describe classes so I'm putting them in headers. This works, but I don't know what the "right" thing to do is for C++. Is there any chance that my approach will come back and bite me? If so, what alterations are required and what precautions should I take?
CODE
#include <various packages>
using namespace std;
// various global declarations snipped
#include "wavelet.h" // defines wavelet class and related functions
#include "profile.h" // defines the profile class and related functions
int main () {
void read_startup(), batch_run(wavelet w);
read_startup();
wavelet W("impulse", 1, 100);
batch_run(W); // uses profile class extensively
return(0);
}
// other functions snipped