title: C++: Does ios::out replace the file with a new one or destoys the content of the file?
body: <p>Assume i have  <code>out.txt</code> containing the text <code>Hello World</code></p>
  
  <p>If i do this</p>
  
  <p><code>fstream ("out.txt" , ios::out)</code></p>
  
  <p>Then if i try to open the file it will be empty.</p>
  
  <p>My question is when i open a file stream to a file with the <code>ios::out</code> flag</p>
  
  <p>The file is empty yes.  </p>
  
  <p>But did it go inside the file and delete all its contents </p>
  
  <p>or did it create a new empty file and overwrote the old one?</p>