Class declarations are usually on a header file(.h). This includes, but not limited to, member declarations, assignment of default values, function prototypes, and library dependencies.
Class definitions/implementation are usually on a .cpp file. Here, the functions prototypes are defined, etc.
One more thing to know is that all functions/method defined inside a class declaration is implicitly inline.
EDIT: I just realized that the function above is a global function.
If a function is global, then it can be called by any eligible entity in the code. In the above case, both class A and B can call getSomething().