fork download
  1. #include <iostream>
  2.  
  3. struct Base {
  4.  
  5. static void print() {
  6. std::cout << member << std::endl;
  7. }
  8.  
  9. protected:
  10. static int member;
  11. };
  12.  
  13. int Base::member = 0;
  14.  
  15. int main() {
  16.  
  17. using namespace std;
  18.  
  19. struct Derived : public Base
  20. {
  21. using Base::member;
  22. };
  23.  
  24. int * pm = &Derived::member;
  25. *pm = 99;
  26.  
  27. Base::print();
  28. }
Success #stdin #stdout 0.02s 2680KB
stdin
Standard input is empty
stdout
99