Yes, that means castPointer not necessarily zero, and the statement may fail. Since while the null pointer constant is zero, a null pointer of some type is not necessarily an address with all bits of zero.
reinterpret_cast has no special provisions for getting zero when casting a null pointer to an int. You can achieve this using logical operators that initialize the variable with 0 or 1 :
int castPointer = (voidPointer != 0);
Johannes Schaub - litb
source share