fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class First
  5. {
  6. public:
  7. virtual void Report() { cout << "First" << endl; }
  8. };
  9.  
  10. class Second : public First
  11. {
  12. public:
  13. virtual void Report() { cout << "Second" << endl; }
  14. Second() { Report(); }
  15. };
  16.  
  17. class Third : public Second
  18. {
  19. public:
  20. virtual void Report() { cout << "Third" << endl; }
  21. };
  22.  
  23. int main()
  24. {
  25. Third third;
  26. return 0;
  27. }
Success #stdin #stdout 0s 5304KB
stdin
Standard input is empty
stdout
Second