title: memcpy only copying one byte over c++
body: <p>I'm trying to use memcpy to convert a TCHAR array into a BYTE array but the memcpy function is only copying 1 TCHAR from the tchar array into the byte array.</p>
  
  <p>I have no idea why this is happening.</p>
  
  <p>Here is a code snippet.</p>
  
  <pre><code>TCHAR test[] = L"This is a test string, its purpose is to do some testing!";
  DWORD testSizeBytes = sizeof(TCHAR) * lstrlen(test);
  LPBYTE byteArray = new BYTE[testSizeBytes+1];
  memcpy(byteArray,test,testSizeBytes);
  </code></pre>
  
  <p>If I used this snippet the byteArray would just contain 'T';</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>EDIT: I fixed the issue (It was a typo). The code I wrote here works flawlessly. My compiler is in a windows VM so I had to retype it here and unknowingly fixed the typo.</p>