title: is it true to do this to malloc array with unknown size
body: <p>I want to make an array with unknown size , is it true to make it like this ? :</p>
  
  <pre><code>int *array,var,i=0;
  FILE *fp;
  fopen=("/home/inputFile.txt","r");
  fscanf(fp,"%d",&amp;var);
  while(fp!=NULL)
  {
      if(var&gt;0)
     {
          array=malloc(sizeof(int));
          array[i++]=var
     }
     fscanf(fp,"%d",&amp;var);
  }
  </code></pre>