 <p>If <code>c_str()</code> is returning to you a copy of the string object internal buffer, you can just use <code>const_cast&lt;&gt;</code>.</p> <p>However, if <code>c_str()</code> is giving you direct access tot he string object internal buffer, make an explicit copy, instead of removing the const.</p>