#include <iostream.h>class A { public: void f() { cout << 1; } }; class B : public A { public: void f() { cout << 2; } };main(){B b; A& a=b; a.f();}