功崇惟志:不懂就问 这不是可以访问嘛 问题5
class A
{
public:
virtual void func2(int a)
{
cout << "A::virtual void func1(int a) " << endl;
}
virtual void func2(double a)
{
cout << "A::virtual void func1(double a) " << endl;
}
};
class B :public A
{
public:
virtual void func2(double a)
{
cout << "B::virtual void func1(double a) " << endl;
}
};
int main()
{
B b;
b.A::func2(1);
return 0;
}
0 点赞 评论 收藏
分享
关注他的用户也关注了: