fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class A
  5. {
  6. public:
  7. virtual void foo()
  8. {
  9. cout << "A::foo" << endl;
  10. }
  11. };
  12.  
  13. class B : public A
  14. {
  15. public:
  16. void foo(int param)
  17. {
  18. cout << "B::foo " << param << endl;
  19. }
  20. };
  21.  
  22. int main()
  23. {
  24. B b;
  25. b.foo();
  26. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:25:11: error: no matching function for call to ‘B::foo()’
     b.foo();
           ^
prog.cpp:25:11: note: candidate is:
prog.cpp:16:10: note: void B::foo(int)
     void foo(int param)
          ^
prog.cpp:16:10: note:   candidate expects 1 argument, 0 provided
stdout
Standard output is empty