Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Lambdas and closures in C#
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { Action<int> lambda = (x) => { lambda = (y) => { lambda = (z) => { Console.WriteLine(x + y + z); }; Console.WriteLine(x + y); }; Console.WriteLine(x); }; lambda(2); lambda(3); lambda(4); } } }
run
|
edit
|
history
|
help
0
Local Time (DateTime)
Class
How do I calculate someone's age in C#?
ZeroMatrix
Des encryption
Matrix Main Diagonal
int-float C# division
Clone Example
find the index of the substring "fir" - Seeni
Lesson 1.2 Part II