title: ofstream doesn't flush
body: <p>I have the following code, running on Suse 10.1 / G++ 4.1.0, and it doesn't write to the file:</p>
  
  <pre><code>#include &lt;fstream&gt;
  #include &lt;iostream&gt;
  
  int main(){
      std::ofstream file("file.out");
      file &lt;&lt; "Hello world";
  }
  </code></pre>
  
  <p>The file is correctly created and opened, but is empty.
  If I change the code to:</p>
  
  <pre><code>#include &lt;fstream&gt;
  #include &lt;iostream&gt;
  
  int main(){
      std::ofstream file("file.out");
      file &lt;&lt; "Hello world\n";
  }
  </code></pre>
  
  <p>(add a <code>\n</code> to the text), it works.
  I also tried flushing the ofstream, but it didn't work.</p>
  
  <p>Any suggestions?</p>