title: Assign pointer instances of structures in C
body: <p>Now I know from this post about <a href="https://stackoverflow.com/questions/2302351/assign-one-struct-to-another-in-c">assigning one struct to another</a> that I can assign a struct variable to another one of the same type and a <strong>shallow</strong> copy will happen.</p>
  
  <pre><code>struct Test t1;
  struct Test t2;
  t2 = t1;
  </code></pre>
  
  <p>But what if I do this?</p>
  
  <pre><code>struct Test *t1;
  struct Test *t2;
  t1 = malloc(sizeof(struct Test));
  t2 = malloc(sizeof(struct Test));
  //assign t1 and t2's fields some data
  *t2 = *t1;
  </code></pre>
  
  <p>Will the same memcpy happen in this case?</p>