#include<iostream>
using namespace std;

class A1{
    public: void f1() {  cout<<"A1类中的函数f1()"<<endl;  }
};

class A2{ public: void f1() {  cout<<"A2类中的函数f1()"<<endl;  }
};

class B:public A1,public A2{
};

int main()
{ B b;
  b.A1::f1();  //b.f1(); 
}

 

二义性

相关文章:

  • 2021-05-29
  • 2021-09-08
  • 2021-05-08
  • 2021-04-25
  • 2021-06-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-23
  • 2021-06-28
  • 2021-08-18
  • 2022-01-27
  • 2022-12-23
相关资源
相似解决方案