title: C++ Pass FILE * as argument to a function
body: <p>I want to pass a FILE * to another function. In this function some bytes are read from the file using fread. No writing is performed.</p>
  
  <p>I was wondering if I should say</p>
  
  <pre><code>void DoSomething(FILE *uFile)
  </code></pre>
  
  <p>or </p>
  
  <pre><code>void DoSomething(const FILE *uFile)
  </code></pre>
  
  <p>I was afraid to introduce a memory leak somewhere and thought that maybe const be safer. 
  I was afraid that the function might create a copy of the file or so when I pass it improperly.</p>
  
  <p>I create FILE * like so:</p>
  
  <pre><code>FILE *outfile  = fopen("c:\\myfile.dat", "wb");
  </code></pre>
  
  <p>Thank you.</p>