Current location - Quotes Website - Signature design - What is the delegation in C#
What is the delegation in C#
If you have studied C/C++, the simplest explanation is that the delegate is a high-level function pointer.

If explained in natural language, entrustment means serving food. When you go to a restaurant to eat and order, you always order a waiter. It seems that the waiter can do everything, but in fact, the waiter entrusts the chef to cook for you.

In other words, authorization has two capabilities:

1. As a symbol of a method, it means any method with the same signature, which is the same as C/C++.

2. Asynchronous ability. Delegates can be executed asynchronously through BeginInvoke, which is unique. Net.

In addition, an event is also a kind of delegation.