title: Why doesn't the C++ compiler complain when I use functions without parentheses?
body: <p>I was looking at some code a friend sent me, and he said: "It compiles, but doesn't work". I saw that he used the functions without the parentheses, something like this:</p>
  
  <pre><code>void foo(){
    cout&lt;&lt; "Hello world\n";
  }
  
  int main(){
    foo; //function without parentheses
    return 0;
  }
  </code></pre>
  
  <p>The first I said was "use parentheses, you have to". And then I tested that code - it does compile, but when executed doesn't work (no "Hello world" shown).</p>
  
  <p>So, why does it compile (no warning at all from the compiler <strong>GCC 4.7</strong>), but doesn't work?</p>