Re: Delegates and the Invoke method

Tech-Archive recommends: Fix windows errors by optimizing your registry



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


.



Relevant Pages

  • Re: GCC difference in size of long int on Suse SLES9 / Suse Professional 10.0
    ... The kernel uses printf() with 'long int', ... I can't compile 'on-the-fly'. ... clashing with the hardware and any libs that you interact with. ... platform types build up their own int types. ...
    (comp.os.linux.development.apps)
  • Re: Im a C++ programmer, and Relfs X.CPP is good.
    ... >> and it doesn't compile either. ... home.cpp:93: implicit declaration of function `int fclose' ... You cannot change to your home directory through an external ...
    (comp.lang.lisp)
  • Re: Im a C++ programmer, and Relfs X.CPP is good.
    ... >> and it doesn't compile either. ... home.cpp:93: implicit declaration of function `int fclose' ... You cannot change to your home directory through an external ...
    (comp.unix.programmer)
  • Re: non-static context
    ... public MyStatic(int length, int width) { ... Within the MyStatic constructor method, a local variable named area is ... This version of class MyStatic won't compile. ...
    (comp.lang.java.help)
  • Re: new order doubt
    ... Warning test2.c: 8 no type specified. ... Defaulting to int ... Tests probably come in several different types: this should compile ... Even Microsoft has problems with this obscure rules. ...
    (comp.lang.c)