title: Using a class and functions to keep track of user stats
body: <p>I am new to C++, and was wondering what I am doing wrong.</p>
  <p>I am trying to create a text-based adventure game that keeps track of player stats using an add or remove function. Currently, my function does not add five points to <code>trust</code> and I am trying to get it to.</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &quot;function.h&quot;
  using namespace std;
  
  int main() {
      double trust=100;
      editPlayer user(100);
      //asks user choice
      cin &gt;&gt; firstChoice;
      if (firstChoice == 1) {
          user.addTrust(trust);
          cout &lt;&lt; trust;
  </code></pre>
  <p>Here is my <code>function.cpp</code> only using trust as an example:</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &quot;function.h&quot;
  
  editPlayer::editPlayer(double trust) {
  }
  
  void editPlayer::addTrust(double trust){
      trust +=5;
  }
  
  void editPlayer::removeTrust(double trust){
      trust -=5;
  }
  </code></pre>
  <p>And here is my <code>function.h</code>:</p>
  <pre class="lang-cpp prettyprint-override"><code>#include&lt;iostream&gt;
  #include&lt;string&gt;
  using namespace std;
  
  class editPlayer{
  public:
      editPlayer(double trust);
      void addTrust(double);
      void removeTrust(double);
  };
  </code></pre>