Apply a callback to an array: Difference between revisions

Content added Content deleted
Line 154: Line 154:
}
}
}
}


'''Language Version:''' 3.0+

This version uses the C# 3 lambda notation.

int[] intArray = { 1, 2, 3, 4, 5 };
Array.ForEach(intArray, i => Console.WriteLine(i * i));


==[[C plus plus|C++]]==
==[[C plus plus|C++]]==