C++ Programming/Programming Languages/C++/Code/Keywords/reinterpret cast

The reinterpret_cast keyword is used to simply cast one type bitwise to another. Any pointer or integral type can be cast to any other with reinterpret cast, easily allowing for misuse. For instance, with reinterpret cast one might, unsafely, cast an integer pointer to a string pointer. It should be used to cast between incompatible pointer types.


 * Syntax:

The  is used for all non portable casting operations. This makes it simpler to find these non portable casts when porting an application from one OS to another.

The  will change the type of an expression without altering its underlying bit pattern. This is useful to cast pointers of a particular type into a  and subsequently back to the original type.