Skip to content

Instantly share code, notes, and snippets.

@toshimaru
Created August 15, 2012 06:37
Show Gist options
  • Save toshimaru/3357128 to your computer and use it in GitHub Desktop.
Save toshimaru/3357128 to your computer and use it in GitHub Desktop.
Action (C# delegate)
class Program
{
static void Main(string[] args)
{
int n = 10;
Action<int> act = (int i) =>
{
Console.WriteLine("num is : {0}", n * i);
};
act(2);
n = 30;
act(2);
Console.Read();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment