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