I'm new to C++. I'm in a situation that I have multiple classes. And I just learned that I need to include the header file of that class in order to use it in my current class.
For example, I have 'main.cpp', 'object1.h', 'object2.h' and 'object3.h'.
I don't know if I should do this way: 'main.cpp' includes all three: 'object1.h', 'object2.h', 'object3.h' (centralized style)
or this way:
'main.cpp' include 'object1.h', 'object1.h' include 'object2.h', 'object2.h' include 'object3.h' (linear style)
And if I want to use object2 in my object3. I probably need to let 'object3.h' additionally include 'object2.h', right?
For this case, I wonder if the standard way is: 1. include the header file when you need to use it. 2. include all possible header file even you do not know if you will use it.