title: How to find EOF through fscanf?
body: <p>I am reading matrix through file with the help of fscanf().
  How can i find EOF?
  Even if i try to find EOF after every string caught in arr[] then also i am not able to find it.</p>
  
  <p>with the help of count i am reading the input file </p>
  
  <p>-12 23 3</p>
  
  <p>1 2 4</p>
  
  <pre><code>int main()
  {
      char arr[10],len;
      int count=0;
  
      FILE *input= fopen("input.txt", "r");
  
      while(count!=7)
      {   
             fscanf(input,"%s",arr);
            //storing the value of arr in some array.
                     len=strlen(arr);
             count++;
  
             if(arr[len+1]==EOF)
             printf("\ni caught it\n");//here we have to exit.
      }
  return 0;
  }
  </code></pre>
  
  <p>Instead of count i want to exit through the loop with the EOF .
  how can it be solved? </p>