what will happen when an array is initialized more than once in c++?
<p>What happens to the memory location when I initialize a variable in c++ more than once? For example:</p>

<pre><code>LPWSTR sampleString = new whcar_t[10];
//some operations here
sampleString = new wchar_t[2];
//some operations here
sampleString = new wchar_t[25];
//some operations here
</code></pre>

<p>If I delete the memory by using <code>delete [] sampleString;</code> will all the associated memory locations be cleared?</p>
