2个回答
展开全部
例子:
void test1()
{cout<<"i am outer test1";}
class A{
void test1()
{cout<<"i am inner test1";]
void test2()
{test1();}
void test3()
{::test1();}
};
void main()
{A a;
a.test2(); //输出i am inner test1
a.test3(); //输出i am outer test1
}
void test1()
{cout<<"i am outer test1";}
class A{
void test1()
{cout<<"i am inner test1";]
void test2()
{test1();}
void test3()
{::test1();}
};
void main()
{A a;
a.test2(); //输出i am inner test1
a.test3(); //输出i am outer test1
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询