Showing posts with label LINQ. Show all posts
Showing posts with label LINQ. Show all posts

Saturday, 22 January 2011

LINQ Quiz...

Can you guess the output of the following code?

var values = new List() { 100, 110, 120 };
var funcs = new List<func<int>>();
foreach (var v in values)
      funcs.Add(() => v);
foreach (var f in funcs)
      Console.WriteLine(f());

If it's not "solved" I will post the answer in the next post...