You can structure a C++ program so that (almost) all the code resides in Header files. It essentially looks like a C# or Java program. However, you do need at least one
The important philosophy of Object Oriented Programming lies in having data hiding leading to encapsulated classes with implementation hidden out from users. This is primarily to provide an abstraction layer where the users of a class primarily use the publicly accessible member functions for instance specific as well as static types. Then the developer of the class is free to modify the actual implementations provided the implementations are not exposed to the users. Even if the implementation is private and declared in a header file, changing the implementation will require all dependent codebase to re-compile. Whereas, if the implementation (definition of the member functions) are in a source code (non-header file), then the library gets changed, and the dependent codebase needs to re-link with the revised version of the library. If that library is dynamically linked one like a shared library then keeping the function signature (interface) same and implementation changed does not require re-linking also. Advantage? Of course.