64,648
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
using namespace std;
class CA
{
protected:
void fun1(int a){cout<<"fun1:"<<a<<endl;}
void fun2(int a){cout<<"fun2:"<<a<<endl;}
};
class CB:public CA
{
public:
using CA::fun1;
void fun2(int a)
{
CA::fun2(a);
}
};
int main()
{
CB b;
b.fun1(3);
b.fun2(5);
return 0;
}
可以的