Possible Duplicate:
Friend scope in C++
I am new to c++ and just wondering it!
Possible Duplicate:
Friend scope in C++
I am new to c++ and just wondering it!
class bar
{
private:
void barMe();
};
class foo
{
private:
void fooMe();
friend bar;
};
In the above example foo class can't call barMe() You need to define the classes this way in order that the friend be mutual:
class foo; // forward
class bar
{
private:
void barMe();
friend foo;
};
class foo
{
private:
void fooMe();
friend bar;
};