fork(1) download
  1. #include <iostream>
  2.  
  3. struct combatEntity
  4. {
  5. virtual void Update() { std::cout << "Combat Entity\n"; };
  6. };
  7.  
  8. struct mob : combatEntity
  9. {
  10. virtual void Update() { std::cout << "Mob\n"; };
  11. };
  12.  
  13. struct monster : mob
  14. {
  15. virtual void Update() { std::cout << "Monster\n"; };
  16. };
  17.  
  18. int main(int argc, char **argv)
  19. {
  20. combatEntity *ce = new monster;
  21. ce->Update();
  22. delete ce;
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0.01s 2812KB
stdin
Standard input is empty
stdout
Monster