C++: Write to an existing file?
<p>In C++, I need to write to an existing file and keep the previous content there.</p>

<p>This is what I have done:</p>

<pre><code>std::ofstream logging;

logging.open(FILENAME);

logging &lt;&lt; "HELLO\n";

logging.close();
</code></pre>

<p>but then my previous text is overwritten (gone). What did I do wrong?</p>

<p>Thanks in advance.</p>
