Skip to content

Instantly share code, notes, and snippets.

Created April 18, 2019 09:23
What would you like to do?
// declaring a delegate
public delegate int AddDelegate(int num1, int num2); // 1
static void Main(string[] args)
AddDelegate d1 = new AddDelegate(add); // 2
int result = d1(7, 2); // 3
public static int add(int a, int b) // function
Console.WriteLine(" A Delegate Called me");
int res;
res = a + b;
return res;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment