fork download
  1. class Foo {
  2. public:
  3.  
  4. virtual int Baz() {
  5. return 0;
  6. }
  7.  
  8. virtual int Baz(int bar) {
  9. return 1;
  10. }
  11.  
  12. };
  13.  
  14. class Bar : public Foo {
  15. public:
  16.  
  17. virtual int Baz( ) override {
  18. return 2;
  19. }
  20.  
  21. };
  22.  
  23. int main ( int argc, char* argv[] ) {
  24.  
  25. Bar b;
  26. b.Baz();
  27. b.Baz( 0xdeadbeef ); // Anyway to access without a using Foo::Baz inside Bar?
  28.  
  29. return 0;
  30. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:17:28: error: expected ';' before 'override'
prog.cpp:21:1: error: expected ';' before '}' token
stdout
Standard output is empty