fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Test
  5. {
  6. void foo();
  7. void foo()
  8. { }
  9. };
  10.  
  11. int main() {
  12. // your code goes here
  13. return 0;
  14. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:7:10: error: ‘void Test::foo()’ cannot be overloaded
     void foo()
          ^~~
prog.cpp:6:10: error: with ‘void Test::foo()’
     void foo();
          ^~~
stdout
Standard output is empty