title: Confused about accessing struct members via a pointer
body: <p>I'm new to C, and am confused by results I'm getting when referencing a member of a struct via a pointer.  See the following code for an example.  What's happening when I reference tst->number the first time?  What fundamental thing am I missing here?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  typedef struct {
     int number;
  } Test;
  
  Test* Test_New(Test t,int number) {
      t.number = number;
      return &amp;t;
  }    
  
  int main(int argc, char** argv) {    
      Test test;
      Test *tst = Test_New(test,10);
      printf("Test.number = %d\n",tst-&gt;number);
      printf("Test.number = %d\n",tst-&gt;number);
      printf("Test.number = %d\n",tst-&gt;number);
  }
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>Test.number = 10
  Test.number = 4206602
  Test.number = 4206602
  </code></pre>