joshua
joshua

Reputation: 2371

A delegate is class or a structure

i really gotta confused ..

  1. delegates are class or only a type. ??
  2. is it necessary for a delegate to be same as a function or function has to save as delegate

Please bear me i am new for .net

Upvotes: 1

Views: 98

Answers (1)

Christoph Grimmer
Christoph Grimmer

Reputation: 4323

Maybe you should take a look at http://msdn.microsoft.com/en-us/library/ms173171.aspx

Basically Delegates are very similar to function pointers. They are like placeholders for a function. So e.g. if you want to write a class which can be customized to use different kinds of sort functions, you could create a delegate and later on fill it with a certain method.

Upvotes: 1

Related Questions