24 lines
362 B
C++
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;
|
|
} |