According to C++ Standard, a reinterpret_cast
of a pointer T*
to some other type pointer Q*
can change or not change the pointer value dep
Reinterpret_cast will never return a different address - it is required to copy the exact address.
In cases of multiple inheritance, like David Rodriguez said, taking the address of one of the bases may return an address that has an offset to the address of the first base. Reinterpret_cast will return that offset address, but if you treat it as the upcast address, hell will ensue.
For upcasting, static_cast can return an different address than the one given. If the address you have is one of the bases, and that address is being at an offset to the first base address, static_cast will return a valid address for the upcasted object, which is equal to the address of the first base and thus not equal to the pointer passed.
To make it short: reinterpret_cast gives you the same address, always. Static_cast and dynamic_cast may return a different address, e.g. in certain cases involving multiple inheritance.
The difference between static_cast and dynamic_cast is that static_cast does not check whether the pointer you give it is the right object for the cast, so be sure of that before calling it.