About base class in derived class initialization

后端 未结 5 1799
醉梦人生
醉梦人生 2021-01-24 10:41

guys. I see several cases like:

class Derived:public Base{

public:
    Derived(...):Base(...){}
}

Is what situation or is there any principle

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-24 11:16

    If don't explitily initialize the base class, the default constructor will be called.

提交回复
热议问题