64,641
社区成员
发帖
与我相关
我的任务
分享
class A
{
struct B
{
int a;
void funB()
{
//如果需要在这里访问funA()函数,如何解决?
}
};
void funA();
};
class A{
public:
struct B
{
int b = 5;
void output(){
A oa;
cout << oa.fun();
}
};
A(){ a = 10; }
int fun(){ return a; }
int a;
};
int _tmain(int argc, _TCHAR* argv[])
{
A::B ob;
ob.output();
return 0;
}
class A
{
friend struct B;
struct B
{
int a;
void funB()
{
funA();
}
};
static void funA();//将funA()声明为static
};
class A
{
struct B
{
int a;
void funB()
{
//如果需要在这里访问funA()函数,如何解决?
}
};
public:
void funA();
};
你说的是这个样子么?