Write a syntax for Hybrid Inheritance in Cpp?


Warning: Trying to access array offset on false in /home3/indiakep/public_html/wp-content/plugins/dw-question-answer/inc/Template.php on line 8
All QuestionsCategory: Cpp LanguageWrite a syntax for Hybrid Inheritance in Cpp?
Chetan Shidling Staff asked 6 years ago

I need short information.

1 Answers
Chetan Shidling Staff answered 6 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
};