
June 5th, 2009, 09:26 AM
|
|
Registered User
|
|
Join Date: Jun 2009
Posts: 1
Time spent in forums: 10 m 46 sec
Reputation Power: 0
|
|
|
Using Delegates a simple example
What is a delegate
Just like its name implies it is a form of delegation ie delegating work to something that will do a piece of work. In this case we use another object (a delegate) to run a method or methods for us.
These are basically function pointers or another name for them is Functors. They do exactly that point to functions stored in memory and when they are called run those functions. These are commonly used in event handling as we will see a little later on and are used by Microsoft components on Windows forms for event handling.
For more information on delegates and how they work have a look at Learn How to Program
|