title: C error: expected expression before ‘FILE’
body: <p>Below is a section of my program code, which I found on the first answer to this forum post:
  <a href="http://www.gamedev.net/topic/266856-how-to-check-if-a-file-exists-in-c/" rel="nofollow">http://www.gamedev.net/topic/266856-how-to-check-if-a-file-exists-in-c/</a></p>
  
  <p>Also, here are some links to material I've read but still not figured it out:</p>
  
  <p><a href="http://www.dreamincode.net/forums/topic/333715-error-expected-expression-before-file/" rel="nofollow">http://www.dreamincode.net/forums/topic/333715-error-expected-expression-before-file/</a>
  <a href="http://www.avrfreaks.net/forum/error-expected-expression-struct" rel="nofollow">http://www.avrfreaks.net/forum/error-expected-expression-struct</a></p>
  
  <pre><code>char filename[100];
  char mode[2];
  
  bool exists(const char * filename)
  {
      FILE * fp;
      if (FILE * fp = fopen(filename, mode))
      {
          fclose(fp);
          return true;
      }
      return false;
  }
  </code></pre>
  
  <p>What I want to do in my whole program is simply create a file, then check if it exists and print to screen whether file creation succesful or not. It should be simple, but I get this error:</p>
  
  <pre><code>foo.c:35:6: error: expected expression before ‘FILE’
  </code></pre>
  
  <p>Sorry if I seem a little all over the place, please help me figure this out. If you want me to include any more data, just ask. Thanks in advance!</p>