Copy const to char*
<p>I have</p>

<pre><code>       std::ostringstream out;
       out &lt;&lt; name &lt;&lt; len &lt;&lt; data;
       std::string const value = out.str();
</code></pre>

<p>I want to copy this const value to a char*</p>

<pre><code>        char* buff; 
        size_t length = strlen(value); 
        buff = new char[(strlen(value))+ 1]; 
        memcpy(nm, value , length + 1); 
</code></pre>

<p>but it is still giving me error? Can you please tell me what I am doing wrong? Thank you.</p>
