#include using namespace std ; class A { public: int x1 ; }; class B : public A { public: int x1B ; }; class C : public A { public: int x1C ; }; int main() { int x1 = 10; float f1 = 10.5 ; x1 = static_cast(f1); cout << "x1:" << x1 << endl ; B bObject ; bObject.x1B = 22 ; A* aObject = &bObject ; //Not valid as aObject contains bObject as the //underlying object C* cObject = static_cast (aObject) ; cout << cObject->x1C << endl ; }