title: Finding new memory address? C++
body: <p>(I tested the address because I was getting errors and I found out the address changed before it was deleted, by the time the delete is called the <code>titlePTR</code> has already changed its address and it is giving me an error saying "<code>BLOCK TYPE IS VALID</code>" I heard this is when you try to delete a pointer that wasn't made by new (So that made me think about the address)</p>
  
  <p>Btw I know I don't have to make a dynamic array but I am reading a book and it is saying to practice saving memory for times where your program doesn't need to run the code. I posted on a few other places and people always nag about "Don't use new blah blah blah"</p>
  
  <p>Here is what is says when it trys to delete <code>titlePTR</code> or <code>bodyPTR</code>:
  <a href="http://postimg.org/image/gt0f8kufn/" rel="nofollow">http://postimg.org/image/gt0f8kufn/</a></p>
  
  <pre><code>if (test == "MapleStory")
  {
      wchar_t *titlePTR = new wchar_t[30]; &lt;-- Example Address: 051
      cout &lt;&lt; titlePTR;
      wchar_t *bodyPTR = new wchar_t[20];
      titlePTR = L"MapleStory";
      bodyPTR = L"Launching MapleStory...";
      MessageBox(NULL, bodyPTR, titlePTR, MB_OK | MB_ICONINFORMATION);
      ShellExecute(NULL, L"open", L"GameLauncher.exe", NULL, L"C:\\Nexon\\MapleStory", 1);
      cout &lt;&lt; endl &lt;&lt; titlePTR; &lt;-- Example Address: 0601 
      delete[] titlePTR;
      delete[] bodyPTR;
  }
  </code></pre>