'reinterpret_cast' casts a pointer to any other type of pointer. It also allows casting from pointer to an integer type and vice versa.
This operator can cast pointers between non-related classed. The operation results is a simple binary copy of the value from a pointer to the other. The content pointed does not pass any kind of check nor transformation between types.
In the case that the copy is performed from a pointer to an integer, the interpretation of its content is system dependent and therefore any implementation is non portable. A pointer casted to an integer enough large to fully contain it can be casted back to a valid pointer.
'reinterpret_cast' treats all pointers exactly as traditional type-casting operators do.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment