Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

Function delegate

//one of three built-in generic delegate types:

class Program
{
    static int Sum(int x, int y)
    {
        return x + y;
    }

    static void Main(string[] args)
    {
        Func<int,int, int> add = Sum;

        int result = add(10, 10);

        Console.WriteLine(result); 
    }
}
 
PREVIOUS NEXT
Tagged: #Function #delegate
ADD COMMENT
Topic
Name
8+9 =