I am a beginner in C++. I have a question regarding C++ design.
My file contains A
,B
,C
,D
,E
class definitions. Class A
contains the API which is used by other applications. I have defined this in a .h
file. Classes B
,C
,D
& E
define concrete classes by inheriting an abstract class which is provided by some library. These definitions are not used by any external application, but only used by class A
.
I have seen online that all the class definitions are provided in an .h
file and the function implementations in a .cpp
file. My question here is, even though class B
,C
,D
& E
definitions are not used externally by anyone, should I define them in the .h
file? If I do define them there anyway, I cannot expose them to other applications, right?