title: Inheritance variables not accessible
body: <p>I want to access the variables from inherited classes. However, the compiler gives the error:furniture.cpp:55:9: error: 'int stool::n_StoolLegs' is private within this context one.n_StoolLegs -1;. </p>
  
  <p>This is a homework assignment however, the assignment says that I need to use 4 variables of type stool. So I inherited the class. Is there maybe another option to modify to modify the inherited variables?</p>
  
  <p>furniture .hpp</p>
  
  <pre><code>#include &lt;ostream&gt;
  #include &lt;string&gt;
  #ifndef FURNIURE_HPP
  #define FURNITURE_HPP
  
  class stool{
  private:
      int n_StoolLegs;
      int n_seats;
  
  public:
      void setStoolLegs(int);
      int getStoolLegs();
      void setSeats(int);
      int getSeats();    
  };
  
  class table {};//not relevant
  
  class furniture: public stool, public table
  {
  private:
      stool one;
      stool two;
      stool three;
      stool four;
  
      table first;
  
  public:
      furniture(){
      one.setStoolLegs(4);
      one.setSeats(1);
  
      void makeMoreHipster();
  
  };
  
  
  #endif 
  </code></pre>
  
  <p>furniture.ccp:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "furniture.hpp"
  
  //begin stool
  void stool::setStoolLegs (int nLegs){
      n_StoolLegs = nLegs;
  };
  
  int stool::getStoolLegs(){
      return n_StoolLegs;
  };
  
  
  void stool::setSeats (int nSeats){
      n_seats = nSeats;
  };
  
  int stool::getSeats(){
      return n_seats;
  };
  //end stool//
  
  
  // begin table
  
  //not relevant
  
  // end table
  
  //start furniture
  
  void furniture::makeMoreHipster(){
      one.n_StoolLegs -1;
  
  
  };
  
  // end furniture//
  </code></pre>