title: Pass struct by reference in C
body: <p>Is this code correct? It runs as expected, but is this code correctly using the pointers and dot notation for the struct?</p>
  
  <pre><code>struct someStruct {
   unsigned int total;
  };
  
  int test(struct someStruct* state) {
   state-&gt;total = 4;
  }
  
  int main () {
   struct someStruct s;
   s.total = 5;
   test(&amp;s);
   printf("\ns.total = %d\n", s.total);
  }
  </code></pre>