The .cpp file includes it's .h file in order to define the things declared in the .h file, and a different .cpp file includes that .h file to use whatever classes/functions it has. But at no point do the two .cpp files communicate with each other directly, so how does the latter .cpp file know how the classes and functions are defined, if the only thing they see are the declarations (and not the definitions)?
Also, is it bad practice to define things in a .h file or declare things in a .cpp file?