Default inheritance access specifier

前端 未结 9 1719
北海茫月
北海茫月 2020-12-04 19:12

If I have for example two classes A and B, such that class B inherits A as follows:

class B: public A

9条回答
  •  盖世英雄少女心
    2020-12-04 19:38

    It's private for class and public for struct.

    Side answer: No, these are definitions of the class according to the standard. Class definition end with a semicolon. On the other hand not all statements end with a semicolon (e.g. an if statement does not).

提交回复
热议问题