title: How to modify parent class' variables from a derived class?
body: <p>I'm pretty sure I know why this isn't working but how do I make this work?
  Ok so I have a parent class that has a bunch of virtual functions and 1 non virtual function</p>
  
  <p>Ex: </p>
  
  <pre><code>class Parent
  {
  private: 
      int variable;
  public:
      virtual void firstfunction(); 
      virtual void secondfunction(); 
      void nonvirtualfunction();
  };
  
  Parent::nonvirtualfunction()
  {
      variable = 5;
  }
  </code></pre>
  
  <p>I have a child class that inherits from the parent class </p>
  
  <pre><code>class Child : public Parent
  {
      void firstfunction();
      void secondfunction();
  }
  
  Child::secondfunction()
  {
      Parent::nonvirtualfunction();
  }
  </code></pre>
  
  <p>When I call nonvirtualfunction inside my child class it doesn't change the value inside the parent class. How do I make it so that I can change the parent class' variables inside the child class?</p>