Do i have to delete wchar_t that i allocated with new?
<p>Lets say i have a class like this:</p>

<pre><code>class LolClass {
    LPWSTR* stuff;
    LolClass::LolClass(LPWCHAR lols) {
        stuff = new LPWSTR[100];
        for (int i = 0; i &lt; 100; i++) {
            stuff[i] = new wchar_t[wcslen(lols)+1];
            wcsncpy(stuffs[i], lols, wcslen(lols)+1);
        }
    }
    LolClass::~LolClass() {
        delete[] stuff;
    }
}
</code></pre>

<p>so if i call </p>

<pre><code>LolClass* veryfunny = new LolClass(L"lol!");
</code></pre>

<p>it would make me 100 lol's, problem is when i call </p>

<pre><code>delete veryfunny;
</code></pre>

<p>it deletes the pointer array but not the individual wchar_t's, if i try and loop through the wchar_t's and delete them then i just crash and i dont know what to do since i know for fact that they are still there even after i delete veryfunny (i checked by passing one of the pointers outside the class)</p>

<p>Thanks!</p>
