TITLE: New cast notation for C++ - reinterpret_cast [ Material taken from "C++ Report", Sept. 94, Vol. 6, No. 7, pp 46-51. ] (continued info on new casts) This article discusses the new reinterpret_cast mechanism, whose syntax is roughly reinterpret_cast (expr) It was design to be used for conversions which are inherently unsafe. It returns a value that is a low-level bit representation of the expression. This is used for converting completely unrelated pointer types unrelated function pointer types integer to pointer types Note that this cast should not be used for casting pointers to navigate a class heirarchy: class X {}; class Y {}; class Z : public X, public Y {}; void foo (Y* py) { Z* pz1 = static_cast (py); // ok Z* pz2 = reinterpret_cast (py); // oops! } extern Z z; f (z); Using the compile-time static type information, static_cast will convert Y* to Z*, causing pz1 to point to the start of the object of type Z to which py is assumed to point. The pz2 will be directly initialized with the unchanged value of py (still INCORRECTLY pointing to the object of type Y).