Why do we need delegates
so as much as I know delegate is a pointer to a function so why do we need to run a function indirectly when I can do it on myself which is much more easier , what are the befifits to use a delegate
You never 'need' to use one thing, there's almost always different approaches. But they are perfect for things like button events. Or, if you need to call a bunch of methods always in synch (one after another), they are very elegant for doing that.
Not that I know C#, but this might be a beneficial read: https://stackoverflow.com/questions/2019402/when-why-to-use-delegates
Delegates are easier. They make things more 'elegant' and compact when used properly. You don't 'need' them though. They are excellent if you ever want to pass methods as parameters. For example, button events: to define what methods would be called on click.
thanks man but any real need to use delegates?
thanks a Lot man