A pointer to function in c++
<p>When I did something with pointer to function I noticed something and didn't understand</p>

<p>I did this:</p>

<pre><code>#include &lt;stdio.h&gt;

int callback(void)
{
   return 5;
}

void call(int (*cpmpare)(void))
{
    int x;
    x = cpmpare();
    printf("%d", x);
}

void main()
{
    int (*compare)(void);
    int *a, b;
    b = 5;
    a = &amp;b;
    compare = callback;
    printf("%p\n", &amp;callback);
    printf("%p\n", compare);
    call(&amp;callback);
}
</code></pre>

<p>And I did <code>compare = &amp;callback</code> instead <code>compare = callback</code> and it did the same, compare got the same address as did callback.</p>

<h3>Why did it work both ways?</h3>

<p>From what I know comparing a pointer and a regular variable will be wrong.</p>
