DekGenius.com
[ Team LiB ] Previous Section Next Section

4.2 Delegates Versus Function Pointers

A delegate is behaviorally similar to a C function pointer (or Delphi closure), but delegates can hold multiple methods, as well as hold the instance associated with each nonstatic method. In addition, delegates, like all other C# constructs used outside unsafe blocks, are type-safe and secure. This means that you're protected from pointing to the wrong type of method or to a method you don't have permission to access.

    [ Team LiB ] Previous Section Next Section