CS Electrical And Electronics
@cselectricalandelectronics

Write a syntax for Hybrid Inheritance in Cpp?

All QuestionsCategory: Cpp LanguageWrite a syntax for Hybrid Inheritance in Cpp?
CS Electrical And Electronics Staff asked 4 years ago

I need short information.

1 Answers
CS Electrical And Electronics Staff answered 4 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
};