c++ hybrid Inheritance

  c++

Email

#include<iostream>
using namespace std;

class A{

public:

void setname()
{
cout << “this my name”;
}
};

class B : public A{

public :

void setdate()
{

cout << “this seicdn of the mane function”;
}
};

class C {

public :

void detele()
{

cout << “this workin of coding”;
}
};

class D : public C, public B
{

public :

void setnamees()
{

cout << “this best coding”;
}

};

int main()
{

D naik;
naik.setname();
naik.setdate();
naik.detele();
naik.setnamees();

}

Spread the Code

Leave a Reply

avatar

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
Notify of