title: Reading and writing from files with a new form
body: <p>I'm trying to read from a file and I have to use a new form of it I'm not really certain how to use. I've posted the code below of what function I have and I'm not sure what to do about this error and how to fix it?</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdlib.h&gt;
  
  double* read_file(FILE* file, int length);
  
  int main(int argc, char* argv[])
  {
      double* array = malloc(10 * sizeof(double));
      int length = atoi(*(argv + 1));
      FILE* file = *(argv + 2);
  
      if (argc &lt; 4 || argc &gt; 4)
      {
          printf(&quot;Insufficient arguments. Check your command line.\n&quot;);
          return 0;
      }
  
      array = read_file(file, length);
      printf(&quot;%p&quot;, array);
      return 0;
  }
  
  double* read_file (FILE* file, int length)
  {
      FILE* ptr;
      double* array = malloc(length * sizeof(double));
  
      int i = 0;
  
      if ((ptr = fopen(file, &quot;r&quot;)) == NULL)
      {
          return 0;
      }
      else
      {
          for (i = 0; i &lt; length; i++)
          {
              fscanf(ptr, &quot;%lf&quot;, (array + i));
          }
      }
  
      fclose(ptr);
  
      return array;
  }
  </code></pre>