Test inheritance in C++
This is just to build up my knowledge in C++
A few constructs for inheritance are not trivial in C++
- How do I call an initialized constructor of the Base class automatically when i call the initialized constuctor of the derived class?
- How do I handle methods with the same name in both derived and base classes?
- In which order base constructor and derived constructor are called?
- In which order base deconstructor and derived deconstructor are called?
Answers
- Derived Constructor ( declare derived args ) : Base Costructor( use base args)
- my_method, Base::my_method
- Base Costructor -> Derived Costructor
- ~Derived Deconstructor -> ~Base Deconstructor