class Foo { public: int x_; int y_; }; class Bar { public: float z_; }; int main(int argc, char **argv) { Foo a, *aptr; Bar b, *bptr; aptr = static_cast<Foo *>(&b); bptr = static_cast<Bar *>(&b); return 0; }