title: Checking for success of fwrite in C, perror
body: <p>With fwrite returning the number of successful elements written to the file, by saying:</p>
  
  <pre><code>if (!(fwrite(...))) {
      fprintf(stderr, "Failure");
      //perror(???)  I sometimes see code that says perror here and I don't know 
      //exactly what this does.
  }
  </code></pre>
  
  <p>Does this check for successful writing to the file?  Are there other things to worry about?  </p>
  
  <p>Thanks.</p>