fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Base {
  5. virtual void foo() = 0;
  6. };
  7. struct Derived : public Base {
  8. void foo() {
  9. cout << "Hello ";
  10. Base::foo();
  11. cout << endl;
  12. }
  13. };
  14.  
  15. void Base::foo() {
  16. cout << " world";
  17. }
  18.  
  19. int main() {
  20. Derived d;
  21. d.foo();
  22. return 0;
  23. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
Hello  world