The compiler accepts it because it is legal C/C++ code. This is not a bug; this is how the
language is DEFINED to behave. It compares the address of the function to the constant 0,
and returns TRUE, because the address of the function is nonzero. What would you expect it
to do? You wrote a perfectly syntactically correct (although semantically nonsensical,
relative to what you expected) statement! In fact, if the compiler gave an error message,
it would be an incorrectly-implemented compiler. THAT would be a compiler bug!
Joseph M. Newcomer [MVP]
MVP Tips: http://www.yqcomputer.com/