title: Visual Studio fopen_s error
body: <p>I tried to open a file with <code>fopen_s</code> in Visual Studio 2017</p>
  
  <p>the code looks like</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main() {
      FILE*fp;
      fopen_s(&amp;fp, "input.txt", "r,css=UTF-8");
      fclose(fp);
      return 0;
  }
  </code></pre>
  
  <p>then i got a run time error which looks like:</p>
  
  <blockquote>
    <p>File:minkernel\crts\ucrt\inc\corecrt_internal_stdio.h Line:684</p>
    
    <p>Expression:("Invalid file open mode", 0)</p>
    
    <p>For information on how your program can cause an assertion failure,
    see the Visual C++ documentation on asserts</p>
  </blockquote>