title: Using fread() to read multiple records
body: <p>Following is my code for inserting data into file</p>
  
  <p>Note: I have one structure named <code>record</code> for that</p>
  
  <pre><code>fwrite(&amp;record, sizeof(record),1,fptr);
  </code></pre>
  
  <p>I use the above code in a loop, to enter multiple records.
  Now,  I have my data reading program as this:</p>
  
  <pre><code>do {
  fread(&amp;record, sizeof(record), 1, fptr);
  printf("\nName: %s \nAddress: %s \nClass Level: %d \nTelepone: %ld",record.name, record.address, record.classlevel, record.telephone);
  }while (feof(fptr));
  </code></pre>
  
  <p>But it only displays only first record.</p>
  
  <p>I also tried using <code>fseek()</code> for that as follows:</p>
  
  <pre><code>do {
  fread(&amp;record, sizeof(record), 1, fptr);
  printf("\nName: %s \nAddress: %s \nClass Level: %d \nTelepone: %ld",record.name, record.address, record.classlevel, record.telephone);
  fseek(fptr,sizeof(record)+1, SEEK_SET);
  }while (feof(fptr));
  </code></pre>
  
  <p>And Still It didn't work!! I am trying to do an small project on C and This File Handling is just getting on my nerves.</p>