title: How to modify a value of a struct within a function? [C]
body: <p>Let's see this code as an example</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  typedef struct 
  {
      int hp;
  }Player;
  
  void lessHp(Player a)
  {
      printf("a.hp = %d\n", a.hp);
      (*Player) -&gt; hp -= 1;
      printf("a.hp now = %d\n", a.hp);
  }
  
  int main()
  {
      Player a;
      a.hp = 1;
      lessHp(a);
      printf("a.hp = %d\n", a.hp);
      return 0;
  }
  </code></pre>
  
  <p>Now, what this program prints is:</p>
  
  <pre><code>a.hp = 1
  a.hp now = 0
  a.hp = 1
  </code></pre>
  
  <p>But how can I make it so that the lessHp function would actually be able to substract 1 from that value? When trying to do it by reference it tells me to use ("->"), but I really, really don't know what that is (I've only used simple pointers, the only thing that I've handled with pointers is dynamic memory allocation).</p>