I am reading reinterpret_cast
documentation at http://en.cppreference.com/w/cpp/language/reinterpret_cast and it says in point 3
that:
A pointer converted to an integer of sufficient size and back to the same pointer type is guaranteed to have its original value, otherwise the resulting pointer cannot be dereferenced safely (the round-trip conversion in the opposite direction is not guaranteed; the same pointer may have multiple integer representations)
So it says that converting an integer to pointer of some type and back to integer not defined. Correct me if I am wrong.
Can you please explain in what cases would this be undefined
? Or why is it undefined
?