Write a syntax for Hybrid Inheritance in Cpp?

All QuestionsCategory: Cpp LanguageWrite a syntax for Hybrid Inheritance in Cpp?
Chetan Shidling Staff asked 5 years ago

I need short information.

1 Answers
Chetan Shidling Staff answered 5 years ago

Syntax For Hybrid Inheritance

class A               // grandparent
{
……
……
};
class B1 : public A              //parent 1
{
…….
……
};
class B2 : public A               //parent 2
{
……
……
};
class C : public B1,public B2   //child
{
…… //inherits public functions from class A,B1 and B2
};