fork download
  1. #include <iostream>
  2. class Base
  3. {
  4. public:
  5. void PreLoad();
  6. virtual void Load() {
  7. std::cout << "load" << std::endl;
  8. };
  9. };
  10.  
  11. void Base::PreLoad() {
  12. Load();
  13. }
  14.  
  15. class Derived : public Base {
  16. public:
  17. virtual void Load() {
  18. std::cout << "Hia" << std::endl;
  19. }
  20. };
  21.  
  22. int main()
  23. {
  24. Derived d = Derived();
  25. d.PreLoad();
  26. return 0;
  27. }
  28.  
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
Hia