fork download
  1. class Base
  2. {
  3. protected:
  4.  
  5. int bi; // Base Class' Integer
  6. };
  7.  
  8. class Derived: public Base
  9. {
  10. public:
  11.  
  12. void func()
  13. {
  14. bi = 0;
  15. di = 0;
  16. }
  17.  
  18. private:
  19.  
  20. int di; // Derived Class' Integer
  21. };
  22.  
  23. int main()
  24. {
  25. Derived d;
  26.  
  27. d.func(); // no problems here
  28. }
  29.  
Success #stdin #stdout 0s 2892KB
stdin
Standard input is empty
stdout
Standard output is empty