Science Fair Project Encyclopedia
Nested function
A nested function is a function which can only be called from its parent function. That is, the scope of the nested function is limited to the current function only. For instance, assuming that C supports nested functions (which it does not):
void foo() {
void bar() {
/* do something */
};
bar();
}
In this case bar is a nested function for foo and can only be called from foo.
Nested functions are useful for creating code blocks that must remain logically separate but are only useful for a specific function as opposed to the entire module or program.
12-03-2008 10:22:39
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details


