title: What are the main differences between fwrite and write?
body: <p>I'm currently writing a callback function in <code>C</code>:</p>
  
  <pre><code>static size_t writedata(void *ptr, size_t size, size_t nmemb, void *stream){
  
          size_t written = fwrite(ptr, size, nmemb, (FILE)*stream);
          return written;
  }
  </code></pre>
  
  <p>This function is going to be used in another function, which does a <code>HTTP</code> request, retrieves the request, and writes it to the local machine. That <code>writedata</code> function will be used for the later part. The whole operation has to be <code>multithreaded</code>, so I was in doubt between <code>write</code> and <code>fwrite</code>. Could someone help me outlining the differences between <code>write()</code> and <code>fwrite()</code> in <code>C</code>, so I could choose which one best fits into my problem?</p>