J
JustSomeGuy
I have a class with a private data member and I want to access it
from a friend function, but Visual Studio 2003 .NET won't let me.
class MyClass
{
private:
static int level;
public:
friend ostream & operator<<(ostream & x, const MyClass & c);
}
int MyClass::level = 0;
ostream & operator<<(ostream & x, const MyClass & c)
{
O << c.level;
}
from a friend function, but Visual Studio 2003 .NET won't let me.
class MyClass
{
private:
static int level;
public:
friend ostream & operator<<(ostream & x, const MyClass & c);
}
int MyClass::level = 0;
ostream & operator<<(ostream & x, const MyClass & c)
{
O << c.level;
}