title: Is there a C++ way to write file with any type of data?
body: <p>Like this function in C:</p>
  
  <pre><code>size_t fwrite ( const void * ptr, size_t size, size_t count, FILE * stream );
  </code></pre>
  
  <p>I've looked in C++ file stream and found this one:</p>
  
  <pre><code>ostream&amp; write ( const char* s , streamsize n );
  </code></pre>
  
  <p>this one only accepts <code>char*</code> instead of <code>void*</code></p>
  
  <p>but does it really matter if I use a <strong>C</strong>-style fwrite function in c++?</p>