using System;
public delegate void DelegateClass(out int arg);
public class Starter {
public static void Main() {
DelegateClass del = MethodA();
int var;
del(out var);
Console.WriteLine(var);
}
public static DelegateClass MethodA() {
int local = 0;
return delegate(out int arg) {
arg = ++local;
};
}
}