For example:
using namespace std;
#include
void funcOne() {
}
void funcTwo( int x ) {
}
int main() {
void (*ptrOne)() = funcOne;
cout &l
Operator overloading in C++ adds all sorts of nasty complexities. (It lets you do awesome stuff too—but sometimes it's just a headache.)
As explained in the other answers, C++ is doing some automatic type coercion on your function pointers. If you just use the good ol' C-style printf
you should get the results you're expecting:
#include
// ...
printf("func1: %p\nfunc2: %p\n", funcOne, funcTwo);