C++中不能在派生类中对父类函数进行重载

查看如下代码段: [c light=”false” toolbar=”false”] #include<iostream> using namespace std; class B { public: int f(int i) { cout << “f(int): “; return i+1; } // … }; class D : public B { public: double f(double d) { cout << “f(double): “; return d+1.3; } // … }; int main() { D* pd = new D;… Continue reading C++中不能在派生类中对父类函数进行重载