title: Write typedef function
body: <p>In the header file I have the following line: </p>
  
  <pre><code>typedef int comparator(int* left, int* right);
  </code></pre>
  
  <p>But when I tried to write a function definition for it like so: </p>
  
  <pre><code>int comparator (int* left, int* right){
      if(left&lt;right) {
          return 1;
      } else if(right&gt;left) {
          return -1;
      } else {
          return 0;
      }   
  }
  </code></pre>
  
  <p>The error I get is: </p>
  
  <blockquote>
    <p>file.c:10: error: ‘comparator’ redeclared as different kind of symbol</p>
  </blockquote>
  
  <p>The function must be typedef'ed because later on in the header file it is used in a method prototype like so: </p>
  
  <pre><code>struct bst_node** search(struct bst_node** root, comparator compare, void* data);
  </code></pre>
  
  <p>So how is this method constructed?</p>