5
shouts

C# lambda and foreach variable « RCode

posted by http://resnikb.wordpress.com/http://resnikb.wordpress.com/ 212 days, 18 hours, 50 minutes ago
Monday, August 17, 2009 10:47:43 AM GMT

« Chaos and Order on DiskType Aliases in C# »C# lambda and foreach variable Posted by Bojan Resnik on June 17, 2009 Can you guess what the output of the following program is?

using System; using System.Collections.Generic;

namespace Lambda { class Program { static void Main(string[] args) { var strings = new[] {"a", "b", "c"}; var actions = CreateActions(strings); actions.ForEach(f => f()); }

    private static List
category: Foundation | clicked: 15 | | source: resnikb.wordpress.com | show counter code
tags: .NET, C#, lambda