C# for C programmers. Episode 1: Delegates

I was browsing the net looking for cute stuff, and reached this place. And I think that for the first time I understood what the buzz word “Delegate” means.

It’s a pointer to a function, only in a nicer shell.

So instead of having:
typedef void (*pFunc) (const char *param1);
We will have a much nicer:
delegate void pFunc (string param1);

A cool thing that totally justifies the update from native code to almost native (but interpreted) code.

So next time someone bothers you with cool features that should make you swarm to .NET, you can find out what (at least one) of those buzz words mean.

For the real documentation of the delegate thingie, see MSDN. (via Bolthead)

PS: (later edit) Actually it’s an array to pointer functions – this is a bit more subtle, but still the idea remains. 🙂

Comments are closed.