So I know that classes can go in a separate .cpp and .h file. But where do I put functions or namespaces? Do they also follow the same a classes? So the declaration of a function is in a .h file, and the definition in the .cpp file? And what about user defined namespaces?
If we are being technical, function declarations go in a header file and the definitions go in a source (cpp) file. Namespaces go wherever yuu want to wrap something in a namespace or use something from an existing namespace. For example, if you have a bunch of function declarations inside of a header file, and you wrap all the functions in a namespace, then the corresponding source file where the functions are defined should also be wrapped in a namespace with the same name.