some more content
This commit is contained in:
27
OOP/inheritance/multiple_inheritance.cpp
Normal file
27
OOP/inheritance/multiple_inheritance.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class myClass {
|
||||
public:
|
||||
void myClass_one() {
|
||||
cout << "Hello World!";
|
||||
}
|
||||
};
|
||||
|
||||
class MyOtherClass {
|
||||
public:
|
||||
void MyOtherClass_Function() {
|
||||
cout << "Hello, I am a other Function!";
|
||||
}
|
||||
};
|
||||
|
||||
class myChildClass: public myClass, public MyOtherClass {
|
||||
};
|
||||
|
||||
int main() {
|
||||
myChildClass classobj;
|
||||
classobj.myClass_one();
|
||||
classobj.MyOtherClass_Function();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user