#include <iostream> using namespace std; class Parent { public: virtual void output(); }; void Parent::output() { printf("Parent!"); } class Son : public Parent { public: virtual void output(); }; void Son::output() { printf("Son!"); } int main() { Son s; memset(&s, 0, sizeof(s)); Parent& p = s; p.output(); return 0; }