A delegate is a type safe function pointer. That is it holds a reference (pointer) to a function.
The signature of the delegate must watch the signature of the function. The delegate points to, otherwise you get a compiler eroor, that is the reason delegates are called as type safe function pointer.
A delegate is just like a class. You can create an instance of it. And when you do so, you pass in the function name as a parameter to the delegate constructor and it is to this function the delegate will point to.
Liked By
Write Answer
Define Delegates?
Join MindStick Community
You have need login or register for voting of answers or question.
Manish Kumar
24-Nov-2017A delegate is a type safe function pointer. That is it holds a reference (pointer) to a function.
The signature of the delegate must watch the signature of the function. The delegate points to, otherwise you get a compiler eroor, that is the reason delegates are called as type safe function pointer.
A delegate is just like a class. You can create an instance of it. And when you do so, you pass in the function name as a parameter to the delegate constructor and it is to this function the delegate will point to.