[.net] [C#] internal, assembly and C++ friends
I'm looking for the C# equivalent of a C++ friend class modifier.
Apparently you can use the 'internal' keyword to implement unrestricted access within the same assembly, but what exactly is defined as an assembly?
Does the code/classes have to be in the same file? Is the executable defined as a single assembly?
Quote:Original post by Rattenhirn
That's right. Assembly is a .dll or .exe file.
So then there is nothing that will allow a single class unrestricted access to another's members? Assuming that the classes are completely seperate and not related (inherited, etc) in any way.
Drat.
Now, is that a good thing or a bad thing? Because I've occasionally found it useful for certain design decisions in C++.
Now, is that a good thing or a bad thing? Because I've occasionally found it useful for certain design decisions in C++.
In C#, the only way I know of to give one class access to the other's private data is to make it a nested class.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement