Answers for "send function as parameter c# and invoke it"

C#
0

send function as parameter c# and invoke it

# cCopyusing System;

namespace pass_function_as_parameter
{
    class Program
    {
        static void functionToPass2(int x)
        {
            int increment = x + 10;
            Console.WriteLine("increment = {0}",increment);
        }
        static void function2(Action<int> functionToPass2)
        {
            functionToPass2(22);
        }
        static void Main(string[] args)
        {
            function2(functionToPass2);
        }
    }
}
Posted by: Guest on September-13-2021

Code answers related to "send function as parameter c# and invoke it"

C# Answers by Framework

Browse Popular Code Answers by Language