A derived class does not have direct access to the private members of the base class; it has to work through the base-class methods. For example, the
RatedPlayer constructors cannot directly set the inherited members (
hasTable). Instead, they have to use public base-class methods to access private base-class members. In particular, the derived-class constructors have to use the base-class constructors.
When a program constructs a derived-class object, it first constructs the base-class object. Conceptually, that means the base-class object should be constructed before the program enters the body of the derived-class constructor. C++ uses the member initializer list syntax to accomplish ...