title: fgets doesn't work -
body: <p>Suddenly fgets stoped working while i haven't done any change that will affect the function 
  here is my code .please let me know why it is not working !? </p>
  
  <pre><code>  void readInfo()
  {struct grades *grades=malloc(3*sizeof(grades));
     char line[60],str[6];
     int i=0;
  
     FILE *rf=fopen("Grades.txt","r");
     if(!feof(rf)&amp;&amp;fgets(line,60,rf)!=NULL)
  
     {           puts("inside if1");
  
  
           while(i&lt;3)
           {
  
               sscanf(line,"%d %s %c",&amp;(grades[i]).ID,str,&amp;(grades[i].grade));
              strcpy(str,((*(grades+i)).course));
                          i++;
              printInfo(grades+i);puts("herwr");
           }
  
     }
     fclose(rf);
  }
  </code></pre>
  
  <p>*********CODE EDITED </p>