Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Forum
September 04, 2009
Why delegates are used?
Posted Date: November 05, 2009 Points: 5
Delegates are similar to pointer.
They are used to save memory.
Check this code.
Delegates are holding one or multiple function address.The delegate designed using pointers so the delegates are unsafe code from the .Net framework.The delegates are reference types.Depending upon the function prototype we have to declare the delegates.Delegates are of two types
1>Single Cast Delegate.
2>Multi Cast Delegate.
Multi Cast Delegate:
The multi Cast delegate refers multiple single cast delegate.
Example on multicast delegate:
public delegate void dname();
public void m1()
public void m2()
private void button1_Click(object sender, EventArgs e)
DelegateDemo obj = new DelegateDemo();
dname d1 = new dname(obj.m1);
dname d2 = new dname(obj.m2);
d3 = d1 + d2;
To post reply
Related Questions Related Questions
what is DELEGATES in .NET?
Latest Forum Questions From The Same Category
How to display the text in the second ck editor with strikes while extracting from database
Mail is working but I want send two excel file to each different person
how to display child nodes with headers and keeping the child nodes in a table
In DataGrid I have Two Dropdownlist, One in Header template and Item Template
Display data directly from database table to PDF using stored procedures in asp.net C#
How to install and use Dev Express ?
Dialogbox Custom Control
Custom Control in Winforms
I just started learning c#.net console application
How to read csv file which have many special character and tabs?
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more
Quick Links For Forum Categories:
Hall of Fame
Terms of Service
Tell A Friend