title: best way to copy TCHAR pointer to TCHAR pointer
body: <p>I dont know why this seems to be more complicated than what it is! I simply want to replace the contents of <code>str2</code> with the contents of <code>str</code>, they are both are strings. This seems to work but I am not sure this is the right way of doing it...I am using Visual Studio 2008.</p>
  
  <p>EDIT: I have to use <code>new</code> for <code>str2</code></p>
  
  <pre><code>TCHAR *str = _T("Hello");
  TCHAR* str2;
  str2 = new TCHAR[23];   // let us say this is big enough 
  str2 = _T("ok");
  memcpy( &amp;str2, &amp;str, (_tcslen(str)+1)*sizeof(TCHAR));
  </code></pre>
  
  <p>EDIT2: I tried this as Michael suggested but I got <code>access violation error</code> :(</p>
  
  <pre><code>TCHAR *str = _T("Hello");
      TCHAR* str2;
      str2 = new TCHAR[23];   // let us say this is big enough 
      str2 = _T("ok");
      _tcscpy( str2, str);
  </code></pre>