fork download
  1. class Base {
  2. private:
  3. int a;
  4. };
  5.  
  6. // Private inheritance.
  7. class A : private Base {
  8. public:
  9. A() {
  10. a = 0;
  11. }
  12. };
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In constructor 'A::A()':
prog.cpp:3:6: error: 'int Base::a' is private
  int a;
      ^
prog.cpp:10:3: error: within this context
   a = 0;
   ^
stdout
Standard output is empty