title: Reading from txt file in C using scanf
body: <p>i have a txt file and i want to read from it. I know that i will have to read 20 lines(each line contain 3 number variables,for instance 10 5 6 and so on)</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main(int argc, char *argv[]) {
  int x,y,z;
  int counter = 0;
  
  FILE *fid;   
  fid = fopen(argv[1],"r");
  
  while(counter&lt;20){
      sscanf(fid,"%d%d%d",&amp;x,&amp;y&amp;z);
      //some operations made on x,y,z
      counter=counter+1;
  }
  
  fclose(fid) ;
  return 0;
  }
  </code></pre>
  
  <p>Unfortunately it is not working.
  I want to go through file and use <code>sscanf(fid,"%d%d%d",&amp;x,&amp;y,&amp;z)</code> 20 times.
  Maybe i should scanf?I would be grateful if somebody could tell me how to make this working.</p>