1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include<iostream> using namespace std; class A{ public: void fun(){cout<<"fun\n";} }; class B: public A{ void fun(int i){cout<<"funB\n";} }; int main() { B b; b.fun(); }
1 2 3
In function 'int main()': Line 16: error: no matching function for call to 'B::fun()' compilation terminated due to -Wfatal-errors.