title: Define a function before main?
body: <p>Are function declarations/prototypes necessary in C99 ?</p>
  
  <p>I am currently defining my functions in a header file and #include-ING it in the main file. Is this OK in C99 ?</p>
  
  <p>Why do most programmers declare/prototype the function before main() and define it after main() ? Isn't it just easier to define them before main and avoid all the declarations/prototypes ?</p>
  
  <p>Contents of header.h file:  </p>
  
  <pre><code>int foo(int foo)
  {
  // code
  return 1;
  }
  </code></pre>
  
  <p>Contents of main file:  </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  #include "header.h"
  
  int main(void)
  {
  foo(1);
  return 0;
  }
  </code></pre>