title: How to sort functions in C? "previous implicit declaration of a function was here" error
body: <p>I'm sure this has been asked before, but I couldn't find anything that would help me.
  I have a program with functions in C  that looks like this</p>
  
  <pre><code>function2(){
    function1()
  }
  function1 (){
    function2()
  }
  
  main () {
   function1()
  }
  </code></pre>
  
  <p>It's more complicated than that, but I'm using recursion. And I cannot arrange the function in the file so that every function would only call functions that are specified above itself. I keep getting an error</p>
  
  <pre><code>main.c:193: error: conflicting types for 'function2'
  main.c:127: error: previous implicit declaration of 'function2' was here
  </code></pre>
  
  <p>How do I avoid this? Thanks in advance for suggestions and answers.</p>