How to concat two const char*?
<p>I am not able to concat two <code>const char*</code>.</p>

<p>I do the following:</p>

<pre><code>const char* p = new char[strlen(metadata.getRoot())+strlen(metadata.getPath())];
strcat(const_cast&lt;char*&gt;(p),metadata.getRoot());
strcat(const_cast&lt;char*&gt;(p),metadata.getPath());

strcpy(const_cast&lt;char*&gt;(args2-&gt;fileOrFolderPath),p);

function(args2-&gt;fileOrFolderPath);
</code></pre>

<p>Now when I print the variable <code>args2-&gt;fileOrFolderPath</code> on the console then the correct output appears... But when I call a method with the variable as parameter, and work with the variable then I got a segmentation fault. What is the problem?</p>
