title: C Functions: static or remove from header
body: <p>[Ansi-C/Eclipse]
  For some reason I did not find anything helpful so here is my Question:</p>
  
  <p>I want <code>bar()</code> to be only accessible to code inside <code>foobar.c</code></p>
  
  <p>Should I:</p>
  
  <ul>
  <li><p>put static in front of the declaration and the definition</p></li>
  <li><p>remove the declaration of <code>bar()</code> from <code>foobar.h</code> and put it in <code>foobar.c</code>?</p></li>
  </ul>
  
  <p>What is the difference? This is my setup:</p>
  
  <p>main.c:</p>
  
  <pre><code>#include "foobar.h"
  
  int main() {
      foo();
  }
  </code></pre>
  
  <p>foobar.h:</p>
  
  <pre><code>#ifndef FOOBAR
  #define FOOBAR
  
  void foo();
  void bar();     //Move to foobar.c?
  
  #endif
  </code></pre>
  
  <p>foobar.c:</p>
  
  <pre><code>#include "foobar.h"
  
  void foo() {
      bar();
  }
  void bar() {    //make this static?
      printf("Hello World");
  }
  </code></pre>