title: Why must a pointer to a char array need strcpy to assign characters to its array and double quotes assignment will not work?
body: <p>The first example does not work when you go to delete the pointer. The program either hangs when I add the null terminator or without it I get:</p>
  
  <p><code>Debug Assertion Failed Expression: _BLOCK_TYPE_IS_VALID(pHead-&gt;nBlockUse)</code> from Visual Studio 2008</p>
  
  <pre><code>//Won't work when deleting pointer:
      char *at = new char [3];
      at = "tw"; //   &lt;-- not sure what's going on here that strcpy does differently
      at[2] = '\0'; // &lt;-- causes program to hang
      delete at;
  
  //Works fine when deleting pointer:
      char *at = new char [3];
      strcpy(at,"t");
      at[1] = 'w';
      at[2] = '\0';
      delete at;
  </code></pre>
  
  <p>So what's going on when I use double quotes instead of strcpy? Both of them will cout the string perfectly and debugger does not show anything different.</p>