fork download
  1. class A
  2. {
  3. protected:
  4. class B
  5. {};
  6.  
  7. public:
  8. void callB(B* b)
  9. {
  10. }
  11. B* getB()
  12. {
  13. return 0;
  14. }
  15. };
  16.  
  17. int main()
  18. {
  19. A a;
  20. //A::B* b; //NOT OK
  21. a.callB(a.getB()); //OK
  22. a.callB(0); //OK
  23. }
Success #stdin #stdout 0s 2892KB
stdin
Standard input is empty
stdout
Standard output is empty