title: WinAPI CreateFile function
body: <p>i have to write CreateFile function in c++
  I wrote this, but it didn't work</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;windows.h&gt;
  #include &lt;string&gt;
  using namespace std;
  
  int main()
  {
      HANDLE hfile = CreateFile(
             ".\temp.txt",                // "\\.\C:" 
             GENERIC_READ, 
             0,
             NULL,
             CREATE_NEW,
             FILE_ATTRIBUTE_NORMAL,
             NULL);
  
      //if (hFile == INVALID_HANDLE_VALUE) cout &lt;&lt; "Unable to create file \n";
      return 0;
  }
  </code></pre>
  
  <blockquote>
    <p>error C2664: 'CreateFileW' : cannot convert parameter 1 from 'const char [10]' to 'LPCWSTR' </p>
  </blockquote>
  
  <p>How can I fix this error?</p>