Why do we need delegates?

Guys, all good day! Please help me to understand why we need delegates in C#. Why not stupid to make a function pointer like in C++ or at least to refer to class method, why come up with such a concept of "delegate"??? Thank you
April 3rd 20 at 18:51
3 answers
April 3rd 20 at 18:53
Delegates can be considered more secure version of a function pointer. With rigidly predetermined function signature, and hence type checking.
Anticipating the next question, events in c# made for the protection of delegates from unauthorized call (as a getter/setter only for the delegate)
April 3rd 20 at 18:55
everything is simple:
- wanna learn C#
- wanna learn C++

ps direct answer to the question elementarno searched on MSDN, a bunch of educational websites and books
pps well, or ready to debate in the comments.
let's start with another question - why do you C#? if that is so cute C++. please a detailed answer
since you posted this in answers, where he actually answer? Teach it, teach it, look there it is, another question. And the answer is where? - fern_Larkin18 commented on April 3rd 20 at 18:58
@fern_Larkin18, to write a lecture? or a gem like "bearded in Zivitere" issued? especially about the events he was there all right here chewed - Lenny commented on April 3rd 20 at 19:01
@Lenny, at least micro the answer though as it is possible for the answer to count - fern_Larkin18 commented on April 3rd 20 at 19:04
a direct answer to the question elementarno searched on MSDN, a bunch of educational websites and books

And toaster do not need. The boys from TechMedia just do not know. - naomie_OReilly commented on April 3rd 20 at 19:07
@naomie_OReilly, toaster changed much in several years. some places have sunk to the level https://www.liveexpert.ru/expert/it
look my dear man, on the list of complaints against Voros, if not noticed, there is a point "the answer is easily searched by search engine"
the presence of this item in the "complaints" directly indicates that the resource was not planned to answer at all on any whim
.. and Yes, if you think I'm wrong in the answer/kamentah - button complaints there too, choose the appropriate - Lenny commented on April 3rd 20 at 19:10
@fern_Larkin18you decided a counter-education to arrange? want take the complaint, but my reaction won't be
.. and the answer is. the more micro. well, he could have written - Lenny commented on April 3rd 20 at 19:13
April 3rd 20 at 18:57
Well, first, there is no sharp pointers. The second is actually inside a pointer, just as wrote above more secure.
well, actually, the delegate is not a pointer, and the object with the Invoke method - vesta commented on April 3rd 20 at 19:00
@vesta, I figuratively. - moises58 commented on April 3rd 20 at 19:03

Find more questions by tags C#