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
I don't think the question is meaningfully different for C++ versus C pointer casts. From this answer I quote only one of the examples:
The Eclipse MV series from Data General has three architecturally supported pointer formats (word, byte, and bit pointers), two of which are used by C compilers: byte pointers for
char*
andvoid*
, and word pointers for everything else
That suggests a reinterpret_cast
could lose its sense of which character/byte in the word was being pointed at, making the operation irreversible.