64,680
社区成员
发帖
与我相关
我的任务
分享
class X
{
public:
friend bool Y::ifelse(X&);
private:
int a;
int b;
};
class Y
{
public:
bool ifelse(X& temp)
{
return temp.a > temp.b ? true : false;
}
};
class Y ; //注意这里,前导声明
class X
{
public:
friend bool Y::ifelse(X&);
private:
int a;
int b;
};
class Y
{
public:
bool ifelse(X& temp)
{
return temp.a > temp.b ? true : false;
}
};
class Y
{
public:
bool ifelse(X& temp)
{
return temp.a > temp.b ? true : false;
}
};
class X
{
public:
friend bool Y::ifelse(X&);
private:
int a;
int b;
};
class X;
class Y
{
public:
bool ifelse(X& temp);
};
class X
{
public:
friend bool Y::ifelse(X&);
private:
int a;
int b;
};
bool Y::ifelse(X& temp)
{
return temp.a > temp.b ? true : false;
}