fork download
  1.  
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. class Foo {
  5. public:
  6. int foo;
  7. void foo() { printf("foo\n"); }
  8. };
  9.  
  10. int main() {
  11. Foo foo;
  12. foo.foo();
  13. return 0;
  14. }
  15.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:7: error: declaration of ‘void Foo::foo()’
prog.cpp:6: error: conflicts with previous declaration ‘int Foo::foo’
stdout
Standard output is empty