title: How do you include a header file that may or may not exist?
body: <p>Let's assume I define BAR in foo.h.  But foo.h might not exist.  How do I include it, without the compiler complaining at me?</p>
  
  <pre><code>#include "foo.h"
  
  #ifndef BAR
  #define BAR 1
  #endif
  
  int main()
  {
      return BAR;
  }
  </code></pre>
  
  <p>Therefore, if BAR was defined as 2 in foo.h, then the program would return 2 if foo.h exists and 1 if foo.h does not exist.</p>