class two;
class one
{
int a;
public:
one()
{
a = 8;
}
friend two;
};
class two
{
public:
two() { }
two(one i)
{
cout << i.a;
}
};
int main()
{
one o;
two t(o);
getch();
}
I'm getting this error from Dev-C++:
a class-key must be used when declaring a friend
But it runs fine when compiled with Microsoft Visual C++ compiler.