// testdev.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> using namespace std; class A { public: A() { cout << "A::A()" << endl;; } ~A() { cout << "A::~A()" << endl; } public: virtual void fun(int n) { cout << "A::fun()" << endl; } }; class B:public A { public: B() { cout << "B::B()" << endl;; } ~B() { cout << "B::~B()" << endl; } public: using A::fun; void fun() { cout << "B::fun()" << endl; } }; int _tmain(int argc, _TCHAR* argv[]) { B b; b.fun(1); return 0; }