Default inheritance access specifier

前端 未结 9 1720
北海茫月
北海茫月 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:34

    the default access specifier is an important differentiator between classes and structs. It is public by default for structs and private by default for classes.

提交回复
热议问题