fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct A {
  5. virtual void Call() {
  6. cout << "A" << endl;
  7. }
  8. virtual void CallCall() {
  9. Call();
  10. }
  11. };
  12.  
  13. struct B : A {
  14. virtual void Call() {
  15. cout << "B" << endl;
  16. }
  17. };
  18.  
  19. int main() {
  20. B b;
  21. A* a = &b;
  22. a->Call();
  23. return 0;
  24. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
B