title: c: reading from files
body: <p>In this function findBookByTitle what is supposed to happen is fp is opened and if a title matches the one given to function it will print the title. It is assumed titles are unique so once a match is found it can stop searching. My problem is i'm not entirely sure how to match the title to something in a file. This is what I have so far...</p>
  
  <pre class="lang-c prettyprint-override"><code>    void findBookByTitle(FILE* fp, char title[])
      {
         FILE * fp = fopen(fp, "r");
         while(!EOF &amp;&amp; *fp = title){
            printf("Title: &lt;%c&gt; \n", title);
         }
         if(EOF &amp;&amp; *fp != title ){
            printf("No books match the title: &lt;%c&gt; ", title);
         }
      }
  </code></pre>
  
  <p>As well when I compile I get a few errors, it might be pointless to address these as my function remains incomplete but a few of these really confuse me.</p>
  
  <p>34: error: 'fp' redeclared as different kind of symbol
  32: note: previous definition of 'fp' was here
  34: warning: passing argument 1 of 'fopen' from incompatible pointer type
  /usr/include/stdio.h:251: note: expected 'const char * <strong>restrict</strong>' but argument is of type 'struct FILE *'
  35: error: invalid operands to binary &amp;&amp; (have 'int' and 'FILE')
  38: error: invalid operands to binary != (have 'FILE' and 'char *')</p>