I\'ve been experimenting with function pointers and found the behavior of the following program rather misterious:
void foo(int(*p)()) { std::cout << p
std::cout << p << std::endl;
here an overload of operator<< which accepts a bool is picked up:
operator<<
bool
basic_ostream& operator<<( bool value );
As p is not null, then 1 is printed.
p
1
If you need to print an actual address, then the cast is necessary, as others mention.