Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

C# Func 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: #Func #Delegate
ADD COMMENT
Topic
Name
4+5 =