fork download
  1. struct S
  2. {
  3. void foo(int);
  4. private:
  5. void foo(float);
  6. };
  7.  
  8. int main()
  9. {
  10. S s;
  11. s.foo(6.0f);
  12. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:5: error: ‘void S::foo(float)’ is private
prog.cpp:11: error: within this context
stdout

Standard output is empty