title: C++ / Concatenate std::string and wchar* to wchar*
body: <p>I want to concatenate a <code>std::string</code> and <code>WCHAR*</code> and the result should be in <code>WCHAR*</code>.</p>
  
  <p>I tried the following code </p>
  
  <pre><code>size_t needed = ::mbstowcs(NULL,&amp;input[0],input.length());
  std::wstring output;
  output.resize(needed);
  ::mbstowcs(&amp;output[0],&amp;input[0],input.length());
  const wchar_t wchar1 = output.c_str();
  const wchar_t * ptr=wcsncat( wchar1, L" program", 3 );
  </code></pre>
  
  <p>I got following errors</p>
  
  <blockquote>
    <p>error C2220: warning treated as error - no 'object' file generated</p>
    
    <p>error C2664: 'wcsncat' : cannot convert parameter 1 from 'const wchar_t *' to 'wchar_t*'</p>
  </blockquote>