朋友 [英] Friend

查看:75
本文介绍了朋友的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在C#中使用友好函数,比如C ++?

How can I use friend functions in C# like C++?

推荐答案

您在C#中最接近的是内部关键字,其中

表示同一个程序集中的任何其他类型都可以访问该成员/类型。


希望这会有所帮助。

-

- Nicholas Paldino [.NET / C#MVP]

- mv * @ spam。 guard.caspershouse.com


" msnews.microsoft.com" <哒********* @ hotmail.com>在留言中写道

新闻:eP **************** @ tk2msftngp13.phx.gbl ...
The closest thing that you have in C# is the internal keyword, which
means that any other type in the same assembly can access the member/type.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"msnews.microsoft.com" <da*********@hotmail.com> wrote in message
news:eP****************@tk2msftngp13.phx.gbl...
我该怎么办?在C#中使用友元函数如C ++?
How can I use friend functions in C# like C++?



C#中没有''朋友''函数。

内部:

访问仅限于当前项目。


受保护的内部:

访问仅限于当前项目或类型派生自

包含的类。


msnews.microsoft.com写道:
There are no ''friend'' functions in C#.

internal:
Access is limited to the current project.

protected internal:
Access is limited to the current project or types derived from the
containing class.

msnews.microsoft.com wrote:
如何在C#中使用友好函数,比如C ++?
How can I use friend functions in C# like C++?






这篇关于朋友的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆