Difference between private, public, and protected inheritance

后端 未结 16 1797
灰色年华
灰色年华 2020-11-21 06:15

What is the difference between public, private, and protected inheritance in C++?

16条回答
  •  情话喂你
    2020-11-21 06:45

    Member in base class : Private   Protected   Public   
    

    Inheritance type :             Object inherited as:

    Private            :   Inaccessible   Private     Private   
    Protected          :   Inaccessible   Protected   Protected  
    Public             :   Inaccessible   Protected   Public
    

提交回复
热议问题