You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Multiple Inheritance is a feature of C++ where a class can inherit from more than one class. i.e one subclass is inherited from more than one base class.
// base class 1
class Animal
{
public:
int legsCount;
int age;
int weight;
public:
void bark()
{
cout << "barking " << endl;
}
};
// base class 2
class Human
{
public:
int height;
string color;
public:
void speak()
{
cout << "speaking" << endl;
}
};
//derrived class derrived from more tha one base class