title: What's the difference between opening a file with ios::binary or ios::out or both?
body: <p>I'm trying to figure out the difference between opening a file like:</p>
  
  <pre><code>fstream *fileName*("FILE.dat",ios::binary);
  </code></pre>
  
  <p>or</p>
  
  <pre><code>fstream *fileName*("FILE.dat",ios::out);
  </code></pre>
  
  <p>or</p>
  
  <pre><code>fstream *fileName*("FILE.dat",ios::binary | ios::out);
  </code></pre>
  
  <p>I found that all of these forms are identical: in all cases, the same output on the file is produced using either <code>*fileName*&lt;&lt;</code> or <code>*fileName*.write()</code>.</p>