title: Writing stringstream contents into ofstream
body: <p>I'm currently using <code>std::ofstream</code> as follows:</p>
  
  <pre><code>std::ofstream outFile;
  outFile.open(output_file);
  </code></pre>
  
  <p>Then I attempt to pass a <code>std::stringstream</code> object to <code>outFile</code> as follows:</p>
  
  <pre><code>GetHolesResults(..., std::ofstream &amp;outFile){
    float x = 1234;
    std::stringstream ss;
    ss &lt;&lt; x &lt;&lt; std::endl;
    outFile &lt;&lt; ss;
  }
  </code></pre>
  
  <p>Now my <code>outFile</code> contains nothing but garbage: "0012E708" repeated all over.</p>
  
  <p>In <code>GetHolesResults</code> I can write </p>
  
  <pre><code>outFile &lt;&lt; "Foo" &lt;&lt; std:endl; 
  </code></pre>
  
  <p>and it will output correctly in <code>outFile</code>.</p>
  
  <p>Any suggestion on what I'm doing wrong?</p>