fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct a
  5. {
  6. virtual void Test() const {std::cout << 'a';}
  7. void CallProc() {Test();}
  8. };
  9.  
  10.  
  11. struct b : public a
  12. {
  13. virtual void Test() const {std::cout << 'b';}
  14. };
  15.  
  16. int main()
  17. {
  18. b* NewB = new b();
  19. NewB->CallProc();
  20. delete NewB;
  21. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
b