title: Converting TCHAR to string in C++
body: <p>I'm trying to convert a TCHAR to a string as in:</p>
  
  <pre><code>std::string mypath;
  TCHAR path[MAX_PATH];
  GetModuleFileName( NULL, path, MAX_PATH );
  </code></pre>
  
  <p>I need to set <code>mypath</code> to that of <code>path</code>. I did a simple loop and concatenated <code>path[index]</code> to <code>mypath</code> and this works but I don't like this way.</p>
  
  <p>I'm new to C++ but have done plenty of C#. I've seen examples of the <code>GetModuleFileName</code> that passes in a "char" but it doesn't like it. It needs the <code>TCHAR</code> or a <code>LPWSTR</code>.</p>