Files
CPP/OOP/inheritance/multilevel.cpp
2025-04-30 16:54:56 +02:00

24 lines
362 B
C++

#include <iostream>
using namespace std;
class Parent {
public:
void function() {
cout << "Parent Class!";
}
};
class MyChild: public Parent {
// Child Function here
};
class MyGrandChild: public MyChild {
// Grandchild Function here
};
int main() {
MyGrandChild classobj;
classobj.function();
return 0;
}