标签:blog http io os ar sp div 2014 art
source from http://blog.csdn.net/steedhorse/article/details/333664
// Test.cpp #include <iostream> using namespace std; class Base { public: void f() { g(); } private: virtual void g() { cout << "Hi, MorningStar! I am g() of Base!." << endl; } }; class Derived : public Base { private: virtual void g() { cout << "Hi, MorningStar! I am g() of Derived." << endl; } }; int main() { Base *pB = new Derived(); pB->f(); delete pB; return 0; }
标签:blog http io os ar sp div 2014 art
原文地址:http://www.cnblogs.com/kyxyes/p/3996201.html