title: What are TCHAR strings and the 'A' or 'W' version of Win32 API functions?
body: <p>What are <code>TCHAR</code> strings, such as <code>LPTSTR</code> and <code>LPCTSTR</code> and how can I work with these? When I create a new project in Visual Studio it creates this code for me:</p>
  
  <pre><code>#include &lt;tchar.h&gt;
  
  int _tmain(int argc, _TCHAR* argv[])
  {
     return 0;
  }
  </code></pre>
  
  <p>How can I, for instance, concatenate all the command line arguments?</p>
  
  <p>If I'd want to open a file with the name given by the first command line argument, how can I do this? The Windows API defines 'A' and 'W' versions of many of its functions, such as <code>CreateFile</code>, <code>CreateFileA</code> and <code>CreateFileW</code>; so how do these differ from one another and which one should I use?</p>