class B;
class A
{
int Func1( B& b ) ;
int Func2( B& b ) ;
};
class B
{
private:
int _b;
friend int A::Func1( B& ); // Grant friend access to one
// function in class B.
};
int A::Func1( B& b ) { return b._b; } // OK: this is a friend.
int A::Func2( B& b ) { return b._b; } // Error: _b is a private member.
I want to declare in C# a function as friend, like up there ....
It is posible, and how?
class A
{
int Func1( B& b ) ;
int Func2( B& b ) ;
};
class B
{
private:
int _b;
friend int A::Func1( B& ); // Grant friend access to one
// function in class B.
};
int A::Func1( B& b ) { return b._b; } // OK: this is a friend.
int A::Func2( B& b ) { return b._b; } // Error: _b is a private member.
I want to declare in C# a function as friend, like up there ....
It is posible, and how?