title: fread() return value in C
body: <p>I am trying to understand how the <code>fread()</code> function in <code>&lt;stdio.h&gt;</code> works and I am confused about the return value of this function.  In the man pages it says</p>
  
  <blockquote>
    <p>RETURN VALUE<br>
           On  success, <code>fread()</code>  and <code>fwrite()</code> return the number of items read
           or written.  This number equals the number of bytes transferred only
           when size is 1.  If an error occurs, or the end of the file is
           reached, the return value is a short item count (or zero).</p>
    
    <p><code>fread()</code> does not distinguish between end-of-file and error, and 
           callers must use <code>feof(3)</code> and <code>ferror(3)</code> to determine which occurred.</p>
  </blockquote>
  
  <p>Could someone please explain to me what is meant by <code>number of items read or written</code> in this context.  Also can anyone provide me with some example return values and their meanings?</p>