c++ 中如何调用基类的虚函数
#include <iostream>
class Base {
public:
virtual void f() { std::cout << "Base::base()" << std::endl; }
};
class Test : public Base {
public:
void f() { std::cout << "Test::test()" << std::endl; }
};
int main()
{
Base *b = new Test();
b->Base::f();
b->f();
}
dd 读的