title: reading int from file store first line in variables in c
body: <p>I am trying to read ints from a txt file and store the first line into three variable and the rest into an array.</p>
  
  <pre><code> while(fgets(lineBuf, sizeof(lineBuf), inputFile) != NULL){
  
     fscanf(inputFile, "%d %d %d", &amp;pages, &amp;frames, &amp;requests);
     printf("\n\nin loop to get first line variables:\n Pages: %d\n frames: %d\n requests: %d", pages, frames, requests);
   }
  </code></pre>
  
  <p>Input file: the numbers with the first row being the first three and every row afterwards just being a single number.</p>
  
  <pre><code>8 12 4 
  4
  3
  4
  ...
  </code></pre>
  
  <p>when i run the program, it skips the 12 and 4.</p>