title: What Happens If You Set Allocated Memory To NULL in C
body: <p>Is there a difference between setting a pointer to NULL before and after allocating it?</p>
  
  <p>For example, is there any difference between</p>
  
  <pre><code>char* c = NULL;
  </code></pre>
  
  <p>and </p>
  
  <pre><code>char* c = malloc(sizeof(char));
  c = NULL;
  </code></pre>
  
  <p>What are the, if any, implications of each of those statements, and is there any difference in calling <code>free(c)</code> in each of those situations?</p>