fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class Father {
  6. public:
  7. void start () {
  8. this->init();
  9. };
  10.  
  11. void init () {
  12. cout << "I'm the father" << endl;
  13. };
  14. };
  15.  
  16. class Child: public Father {
  17.  
  18. };
  19.  
  20. int main (int argc, char** argv) {
  21. Child child;
  22. child.init();
  23. }
Success #stdin #stdout 0.01s 5516KB
stdin
Standard input is empty
stdout
I'm the father