Passing function pointers - semantics
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/6893285/why-do-all-these-crazy-function-pointer-definitions-all-work-what-is-really-goi">Why do all these crazy function pointer definitions all work? What is really going on?</a>  </p>
</blockquote>



<p>I would be grateful for an explanation why in the code</p>

<pre><code>void f(int&amp; i)
{
  i++;
}

void g(void (passed_f)(int&amp;),int&amp; a)   //`passed_f` equivalent to `*passed_f`
{
  passed_f(a);
}

int main()
{
  int n=0;
  g(f,n);                              //`f` is equivalent to `&amp;f`
}
</code></pre>

<p>both of the equivalences hold, in the sense of not producing any errors, and giving exactly the same result, <code>1</code>. It seems, that it does not matter if we accept in <code>g</code> a pointer to a function, or a function itself... I also presume that [c]-tag is appropriate.</p>
