C++ Base Class Function Overloading in a Subclass [duplicate]
问题 This question already has answers here : Why does an overridden function in the derived class hide other overloads of the base class? (4 answers) Closed 4 years ago . Given the following... #include <iostream> using namespace std; class BaseClass { public: void Func(float f) { cout << "BaseClass:Func() called!"; } }; class SubClass : public BaseClass { }; int main() { SubClass sub; sub.Func(1.1f); return 0; } This runs pretty much as one would expect, resulting in the following output...