DWiki /
Nested Functions
Difference (previous author) (Change, Edit, normal page display)
Changed: 1c1,23
|
Describe the new page here. |
|
Functions may be nested within other functions: int bar(int a) { int foo(int b) { int abc() { return 1; } return b + abc(); } return foo(a); } void test() { int i = bar(3); // i is assigned 4 } See also /FunctionLiterals. (From DWiki) |
Functions may be nested within other functions:
int bar(int a)
{
int foo(int b)
{
int abc() { return 1; }
return b + abc();
}
return foo(a);
}
void test()
{
int i = bar(3); // i is assigned 4
}
See also /FunctionLiterals.
(From DWiki)