代表的用途是什么? [英] What is the use of delegate?

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

问题描述

What is the use of delegate?





我的尝试:



据我所知,使用delegate是一个类型安全的函数指针并间接调用该函数。我们可以直接调用该方法然后委托的主要目的是什么请任何人帮助我。



What I have tried:

In my knowledge use of delegate is a type safe function pointer and calling the function indirectly.we can call the method directly also then what is the main purpose of delegate please any one help me.

推荐答案

您应该使用您首选的网络搜索引擎获取大量解释...

官方:代表(C#编程指南)| Microsoft Docs [ ^ ]

这里有一篇关于它的文章列表:搜索 [ ^ ]
You should use your preferred web search engine to get huge amount of explanations...
The official: Delegates (C# Programming Guide) | Microsoft Docs[^]
And a list of articles about it here: Search[^]


Quote:

据我所知,委托的使用是一种类型安全函数指针和间接调用函数

In my knowledge use of delegate is a type safe function pointer and calling the function indirectly

你的知识是正确的。



Your knowledge is right.

Quote:

我们可以直接调用方法然后主要目的是什么

we can call the method directly also then what is the main purpose

仍然,委托的目的是'安全函数指针'。

Still, the purpose of the delegate is the 'safe function pointer' one.


这篇关于代表的用途是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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