static int[] Processor(int[] values, Tramsformer tramsformer) { for (var i = 0; i < values.Length; i++) { values[i] = tramsformer(values[i]); } return(values); }
public static void Sample2() { Tramsformer squarer = Squared; int[] values = { 1, 2, 3 }; var results = Processor(values, squarer); Console.WriteLine("{0}, {1}, {2}", results[0], results[1], results[2]); Console.ReadLine(); }