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