fork(1) download
  1. #include <iostream>
  2.  
  3. struct base {
  4. base() { test(); }
  5. virtual void test() { std::cout << "base" << std::endl; }
  6. };
  7.  
  8. struct derived : base {
  9. void test() { std::cout << "derived" << std::endl; }
  10. };
  11.  
  12. int main()
  13. {
  14. derived d;
  15. return 0;
  16. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
base