title: Semantics of assignment of an unitialized pointer in regards to structures
body: <p>Okay, let's say you have this struct:</p>
  
  <pre><code>struct Person
  {
      int age;
      int height;
  };
  </code></pre>
  
  <p>Now you have this function to create a pointer to this struct:</p>
  
  <pre><code>struct Person *person (int *age, int *height)
  {
      struct Person *person = malloc(sizeof(Person));
      person -&gt; age = age;
      person -&gt; height = height;
      return person;
  }
  </code></pre>
  
  <p>Then, in the main function you have this:</p>
  
  <pre><code>struct Person *tom;
  </code></pre>
  
  <p>Here lies my problem, I don't know if to assign these I do this:</p>
  
  <pre><code>*tom = person(20, 70);
  </code></pre>
  
  <p>Or this:</p>
  
  <pre><code>tom = person(20, 70);
  </code></pre>
  
  <p>Let me know if any further clarification is needed, I'm sure this is just a simple misunderstanding on my part, alas.</p>