delegate object as an argument

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • James

    #1

    delegate object as an argument

    Hello,

    I tried to pass a delegate object to a function, it works fine if the
    access modifier is private but gives me a compile error when the
    access modifier of the function is public. Can anyone explain why ?
    ex:
    class
    {
    delegate int testdelegate(in t temp) ;
    public void testfunction1(t estdelegate test, int temp) //gives
    errror
    { }
    private void testfunction2(t estdelegate test,int temp) //works fine
    { }
    static void Main()
    { }
    }

    Thanks,
    James.
Working...