title: Difference between malloc and realloc?
body: <p>Suppose I've two code samples for creating a integer array of 10 elements:</p>
  
  <pre><code>int *pi = (int*)0; 
  realloc(pi,10);
  </code></pre>
  
  <p>and the other is the one that is written normally, i.e.:</p>
  
  <pre><code>int *pi;
  pi= malloc(10*sizeof(int));
  </code></pre>
  
  <p>Now, my question is: The first type of assignment is legal but not used. Why, although there I may get the starting location of my choice?<br>
  Initialization of pointers with constants are legal but not used. Why?</p>