WHAT IS THE SYNTAX?
COULD YOU PLEASE GIVE ME AN EXAMPLE?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Upamanyu Roy ChoudhuryPosted Feb 20, 2013, 1:44 PM
We all know what is a function pointer in C++.
Delegate is the same thing in C#, it encasupates or holds a method.
It is suitable for anonymous method invocation i.e. it will be called as per situaion in the runtime and it forms the basis of event handling modeel.
The event handler like say a button click is nothing but a delegate , when a click event of the button occurs the delegate is called.
Below mentioned all the links shows delegate example in depth
http://www.codeproject.com/Articles/71154/C-Delegates-101-A-Practical-Example
http://msdn.microsoft.com/en-us/library/aa288459(v=vs.71).aspx
http://geekswithblogs.net/joycsharp/archive/2008/02/15/simple-c-delegate-sample.aspx
If there is any further query then keep me posted
Please mark it as an answer if you find this post as useful
VulpesPosted Feb 19, 2013, 9:49 AM
The output is: