fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. class A {
  7.  
  8. protected:
  9. std::vector<int> v;
  10.  
  11. };
  12.  
  13. class B: public A {
  14.  
  15. void doSomething() {
  16. this->v.push_back(10);
  17. }
  18.  
  19. };
  20.  
  21.  
  22. int main() {
  23. B b;
  24.  
  25. // B.v tutaj już nie jest dostępne
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 0s 3408KB
stdin
Standard input is empty
stdout
Standard output is empty