Apply a callback to an array: Difference between revisions
Content added Content deleted
(Undo revision 9310 by Special:Contributions/216.195.206.231 (User talk:216.195.206.231)) |
(→[[C sharp | C#]]: C# 3) |
||
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++]]== |