Please note, this is a STATIC archive of website www.w3schools.com from 05 May 2020, cach3.com does not collect or store any user information, there is no "phishing" involved.
#include
using namespace std; // Parent class class MyClass { public: void myFunction() { cout << "Some content in parent class." ; } }; // Child class class MyChild: public MyClass { }; // Grandchild class class MyGrandChild: public MyChild { }; int main() { MyGrandChild myObj; myObj.myFunction(); return 0; }
Some content in parent class.