fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class A{
  5. };
  6.  
  7. class B : private A{
  8.  
  9. };
  10.  
  11. int main() {
  12. A* a = new B();
  13. return 0;
  14. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:12:15: error: ‘A’ is an inaccessible base of ‘B’
  A* a = new B();
               ^
stdout
Standard output is empty