开发者

Multiple inheritance in C++ [closed]

开发者 https://www.devze.com 2023-02-06 10:26 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can 开发者_开发知识库be reopened, visit the help center. Closed 12 years ago.

As you know, C++ allows multiple inheritance. But, would it be a good programming approach to use multiple inheritance or it should be avoided?

Thanks.


In general, it's not needed and can make your code more complex.

But there are cases where it's useful. As long as it's useful and isn't causing your code to become unmanageable, I see no reason to avoid it.

0

精彩评论

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

关注公众号