For example:
using namespace std;
#include
void funcOne() {
}
void funcTwo( int x ) {
}
int main() {
void (*ptrOne)() = funcOne;
cout &l
Try this instead:
void (*ptrOne)() = funcOne;
cout << reinterpret_cast(ptrOne) << endl;
void (*ptrTwo)( int x ) = funcTwo;
cout << reinterpret_cast(ptrTwo) << endl;
int (*ptrMain)() = main;
cout << reinterpret_cast(ptrMain) << endl;
I think normally, function overloading rules mean that the version of << being called is operator<<(bool), which means:
cout << ptrOne << endl;
Gets transformed into:
cout << (ptrOne != NULL) << endl;
Which is the same as:
cout << true << endl;