title: variable has not changed? calling through function of a vector
body: <p>Here is my code, i have done multiple tests to make sure the adding of objects into vector is correct. So i try to advance from there a little more.
  My program is that a Voter class will a vector of BallotPaper, whereas a BallotPaper will have a vector of Candidate. The Candidate class will have a private variable called _votecount. </p>
  
  <p>What I want to perform is that, I want to increase _votecount through Voter, using function <code>Vote(int,int)</code>.</p>
  
  <p>However in my case the _votecount does not increment as I have expected and I cant figured out, probably something obvious, thus I appreciate any inputs.</p>
  
  <p>Here is my main:</p>
  
  <pre><code>int main()
  {
      Date d1(2018, 10, 1);// new Date object
      Member m1("Alice", 100, "Engineering", 012, d1, PositionType::Normal);
      bool check = m1.CheckEligibility();
      cout &lt;&lt; check&lt;&lt;"\n";
  
      Voter v1("Ailee", 100, "Engineering", 012, d1, PositionType::Normal);
      if (v1.getName() == "Ailee")
      {
           cout &lt;&lt; "\nTrue1\n";   // Yes
      }
  
      BallotPaper bp1(PositionType::President);
      v1.AddBallotPaper(bp1);
      if (v1.getBallotPapers()[0].getPositionBP() == PositionType::President)
      {
          cout &lt;&lt; "\nTrue2\n"; //Yes
      }
  
       Candidate c1("Ailee", 100, "Engineering", 012, d1, PositionType::Normal);
       v1.getBallotPapers()[0].AddCandidate(c1);
       if (v1.getBallotPapers()[0].getCandidates()[0].getName() == "Ailee")
       {
           cout &lt;&lt; "\nTrue3\n";   //Yes
       }
  
  // Voter cast vote to increase candidate count
      v1.Vote(0, 0);
  
      if (c1.getVoteCount() == 1)
      {
           cout &lt;&lt; "\nDONE\n";     //ERROR HERE!
      }
      return 0;
  }
  </code></pre>
  
  <p>Voter class</p>
  
  <pre><code>class Voter :public Member
  {
      private:
          std::vector&lt;BallotPaper&gt; _bp;  
      public:
          Voter::Voter(std::string a, int b, std::string c, int d, Date e, PositionType f) : Member(a, b, c, d, e, f) 
  {}
  
       void Voter::AddBallotPaper(BallotPaper b)
      {
            _bp.push_back(b);  
      }
  
      std::vector&lt;BallotPaper&gt;&amp; Voter::getBallotPapers()
      {
           return this-&gt;_bp;
      }
  
  //HOW DO YOU VOTE?
       void Voter::Vote(int paperindex,int index)
       {
             getBallotPapers()[paperindex].ChoiceVoted(index);   
       }
  }
  </code></pre>
  
  <p>BallotPaper class</p>
  
  <pre><code>class BallotPaper
  {
        private:
            PositionType _positionbp;
        std::vector&lt;Candidate&gt; _candidatesbp;   // only contain the required candidate
        public:
            BallotPaper::BallotPaper(PositionType a)
            {
               _positionbp = a;
            }
  
            std::vector&lt;Candidate&gt;&amp; BallotPaper::getCandidates()
            {
                return this-&gt;_candidatesbp;
            }
  
           void BallotPaper::AddCandidate(Candidate c)
           {
               _candidatesbp.push_back(c);
           }
  
           void BallotPaper::ChoiceVoted(int index)
           {
               getCandidates()[index].IncreaseVoteCount();
           }
  }
  </code></pre>
  
  <p>Candidate Class</p>
  
  <pre><code> class Candidate :public Member
  {
       private:
           int _votecount;
           PositionType _position;
       public:
           void Candidate::IncreaseVoteCount()
           {
               _votecount++;
           }
  }
  </code></pre>