title: How do I convert wchar_t* to std::string?
body: <p>I changed my class to use std::string (based on the answer I got <a href="https://stackoverflow.com/questions/4339067/const-char-in-my-class-has-junk-characters-after-its-returned-from-function">here</a> but a function I have returns wchar_t *. How do I convert it to std::string?</p>
  
  <p>I tried this:</p>
  
  <pre><code>std::string test = args.OptionArg();
  </code></pre>
  
  <p>but it says error C2440: 'initializing' : cannot convert from 'wchar_t *' to 'std::basic_string&lt;_Elem,_Traits,_Ax>'</p>