07-24-2023, 12:26 PM
> **Possible Duplicate:**
> [Why does C# not provide the C++ style ‘friend’ keyword?](
<!-- End of automatically inserted text -->
I'd like the private member variables of a class to be accessible to a Tester class without exposing them to other classes.
In C++ I'd just declare the Tester class as a friend, how do I do this in C#? Can someone give me an example?
> [Why does C# not provide the C++ style ‘friend’ keyword?](
[To see links please register here]
)<!-- End of automatically inserted text -->
I'd like the private member variables of a class to be accessible to a Tester class without exposing them to other classes.
In C++ I'd just declare the Tester class as a friend, how do I do this in C#? Can someone give me an example?