title: Read block of characters from file at a time and next block in next cycle in C
body: <p>Suppose I have 100 characters in a <strong>file</strong>. I want to read 10 character at a time, work with that and next I want to read 11th-20th = 10 characters and work with them and so on.</p>
  
  <p>Now how can I read this block of data using C? Also say if there are only 5 charactes left then it shouldn't go into an error, rather give me a count of how much characters read this time.</p>
  
  <p>All the methods found over net suggest me to read all character at once or read character one by one. I saw </p>
  
  <pre><code>char but[20];
  fread(buf, 1,10, fp);
  </code></pre>
  
  <p>This looked promising. But I'm unable to use it for my purpose. After reading the 1st to 10th character how can I instruct to bring 11th to 20th character?</p>
  
  <p>C solutions are required but C++ solutions can be used as well.</p>