title: fopen / fopen_s and writing to files
body: <p>I'm using fopen in C to write the output to a text file. The function declaration is (where <code>ARRAY_SIZE</code> has been defined earlier):</p>
  
  <pre><code>void create_out_file(char file_name[],long double *z1){  
    FILE *out;  
    int i;  
  
    if((out = fopen(file_name, "w+")) == NULL){  
      fprintf(stderr, "***&gt; Open error on output file %s", file_name);  
      exit(-1);  
    }  
  
    for(i = 0; i &lt; ARRAY_SIZE; i++)  
      fprintf(out, "%.16Le\n", z1[i]);  
    fclose(out);  
  }  
  </code></pre>
  
  <p>My questions: </p>
  
  <ol>
  <li><p>On compilation with MVS2008 I get the warning: warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. I haven't see much information on <code>fopen_s</code> so that I can change my code. Any suggestions?  </p></li>
  <li><p>Can one instruct <code>fprintf</code> to write numbers at a desired numerical precision <strong>to a file</strong>? If I'm using <code>long double</code> then I assume that my answers are good till 15 digits after the decimal point. Am I right?  </p></li>
  </ol>