开发者

C++ inheritance type [duplicate]

This question already has answers here: Closed 12 years ago.

Possible Duplicate:

Default inheritance access specifie开发者_开发技巧r

When class A inherits from class B:

class A: B {...}

Since I didn't specify the type of inheritance, What will the type of inheritance be? Will it be private since it is the default? Or, is there some sort of dependency here? In other words, will the inheritance type depend on the inherited class or the inheriting class?

Thanks.


If you don't specify anything, it will be private by default for classes. For structs it will be public by default.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜