title: error C4996: visual studio: why do I get an error when I use fopen in c?
body: <p>I just started to work with files so I made this program that just opens a file but i get the error:</p>
  
  <pre class="lang-none prettyprint-override"><code>error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
  </code></pre>
  
  <p>here is the code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      FILE* f = fopen("myFile.txt", "w");
      if (f == NULL)
      {
          printf("error\n");
          return;
      }
      fclose(f);
  }
  </code></pre>