Delete a character array in VC++
<p>I have the following code. When I try to delete the pDest, error occurs. How can I delete pDest. Is there any other operation need to delete this?</p>

<pre><code>{
    int nReqLen = nSrcLength;
    char* pDest = new char[nReqLen+1];
        .
        .
        .
        .
    memcpy( (char*)pSource, pDest, nSrcLength );
    delete pDest;
    return nReturn;
}
</code></pre>
