return a lambda function
using System;
delegate int NumericSequence();
class Test {
static NumericSequence Natural() {
int seed = 0;
return () => seed++;
}
static void Main() {
NumericSequence natural = Natural();
Console.WriteLine(natural());
Console.WriteLine(natural());
}
}
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
|