Re: Delegates and the Invoke method
- From: Dom <dolivastro@xxxxxxxxx>
- Date: 18 May 2007 08:16:52 -0700
Thanks for the info, gives me a better mental picture, but I'm
confused about this.
It's absolutely more type-safe. In C, you could set a function pointer
to anything in memory, and when you tried to execute it, the program
crashed. In C#, if the signature does not match, then your program doesn't
compile.
If I remember by C days, the pointer was declared like this:
int (*ptrFunction) (int, string)
.... and I think the compiler did fail if you set ptrFunction to a
function with the wrong signature. Am I wrong about that?
Dom
.
- References:
- Delegates and the Invoke method
- From: Dom
- Re: Delegates and the Invoke method
- From: Nicholas Paldino [.NET/C# MVP]
- Delegates and the Invoke method
- Prev by Date: Re: Transparency Control
- Next by Date: Re: Application.Run() In a Windows Service
- Previous by thread: Re: Delegates and the Invoke method
- Next by thread: Re: Delegates and the Invoke method
- Index(es):
Relevant Pages
|