Possible Duplicate:
are there function pointers in c#?
I’m interested in finding the difference between delegate in C# and function pointer in C++.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A delegate in C# is a type-safe function pointer with a built in iterator.
It’s guaranteed to point to a valid function with the specified signature (unlike C where pointers can be cast to point to who knows what). It also supports the concept of iterating through multiple bound functions.
In C#, delegates are multi-cast meaning they can iterate through multiple functions. For example: