title: Why does int main() {} compile?
body: <p>(I'm using Visual C++ 2008) I've always heard that main() is <em>required</em> to return an integer, but here I didn't put in <code>return 0;</code> and and it compiled with 0 errors and 0 warnings!  In the debug window it says the program has exited with code 0.  If this function is named anything other than main(), the compiler complains saying 'blah' must return a value.  Sticking a <code>return;</code> also causes the error to appear.  But leaving it out completely, it compiles just fine.</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main()
  {
      cout &lt;&lt; "Hey look I'm supposed to return an int but I'm not gonna!\n";
  }
  </code></pre>
  
  <p>Could this be a bug in VC++?</p>