Log in

View Full Version : C# Delegates?


Typhoon
04-13-2005, 01:04 PM
I'm learning about C# delegates, but I don't fully grasp its purpose. Could somebody explain this to me? Thanks. I couldn't find a good definition online...

paulzazzarino
04-15-2005, 06:43 PM
Run time type safe Function pointers.

These conform to the sandbox theory of the .NET common language runtime environment.

You use them to invoke functions, but they are not dangerous like regular C function pointers. Especially in the hands of inept programmers.

Typhoon
04-15-2005, 10:23 PM
What's the sandbox theory?

Kowalski
04-16-2005, 08:32 AM
let me explain what the sand box theory is
when you are coding in c++, you have access to almost all system component and resources directly (especially if you are writing drivers, vxd etc.) and any bug in your program will likely to cause system crash or system instability.
c# programs are encapsulated with the .net runtime environment, and every call made by the program are processed by .net run time, not the program itself. the runtime checks the code so that the program cant harm the system(wild pointers, stack overflow, resources that are not freed)
so a c# program cant access the system resources directly, thus living in a sandbox