title: C - fscanf() - Reading Data Into an Array
body: <p>I'm getting a strange error when reading my data into an array. My goal is to read a file that has a single column of numbers into an array, line-by-line.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
      int numArray = [20];
      int i = 0;
  
      FILE *infile;
      infile = fopen("numbers", "r");
  
      while(!feof(infile))
      {
          fscanf(infile,"%d",&amp;numArray[i]);
          i++;
      }
  
      fclose(infile);
      return 0; }
  </code></pre>
  
  <p>This is my compile error:</p>
  
  <blockquote>
    <p>sort_algorithms.c: In function ‘main’: sort_algorithms.c:6: error:
    expected expression before ‘[’ token sort_algorithms.c:16: error:
    subscripted value is neither array nor pointer</p>
  </blockquote>