The reinterpret_cast operator allows pointers to one type to be converted to pointers of another type, and it can convert from a pointer to an integer and an integer to a pointer:
double pi = 3.1415; int i = reinterpret_cast<int>(&pi); cout << hex << i << endl;
Unlike static_cast, this operator always involves a pointer: converting between pointers, converting from a pointer to an integral type, or converting from an integral type to a pointer. In this example, a pointer to a double variable is converted to an int and the value printed to the console. In effect, this prints out the memory address of the variable.