Actual advantage of Delegates ??
Below is a valid example of a very simple Delegate.
Invocation is done at the line:
sd();
My Question is that whatever happens by calling "sd();"
can also be achieved by calling the "ActualFunction();"
Then WHY are we calling the other way round ??
using System;
namespace SimpleDelegateExample
{
delegate void SimpleDelegate();
class TestDelegate
{
static void ActualFunction()
{
Console.WriteLine("called by delegate..");
}
static void Main1()
{
SimpleDelegate sd = new SimpleDelegate(ActualFunction);
sd();
}
}
}