Last update November 15, 2003

DWiki /
Nested Functions



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)

FrontPage | News | TestPage | MessageBoard | Search | Contributors | Folders | Index | Help | Preferences | Edit

Edit text of this page (date of last change: November 15, 2003 5:50 (diff))