-
We know that a function can be recursive but i want to know that does nested function possible in any programming language?0
-
Member • Jul 23, 2010
Yes. A function is just a collection of programming. And instead of writing all that programming each time you want to use it, you can stick it in a function. Then just use that function name in your program wherever you need to use it.
So a program to "do your chores"...
Main Program DoYourChores
{
Do ChoresList
If weekend
{
Do ChoresList
Relax
}
}
Function ChoresList
{
Clean yard
Wash dishes
Take out trash
}
Function Relax
{
Watch TV
}Are you sure? This action cannot be undone. -
Member • Jul 23, 2010
Realy
Is it possible ?
It means a function may be defined within main function ?Are you sure? This action cannot be undone. -
Member • Jul 23, 2010
Nested function defines...
#-Link-Snipped-#Are you sure? This action cannot be undone. -
Member • Aug 1, 2010
Yes a function can be nested.Are you sure? This action cannot be undone. -
Member • Aug 2, 2010
Is this possible in C programming or JAVA?arunravindranYes a function can be nested.Are you sure? This action cannot be undone. -
Member • Aug 2, 2010
Hi,
Sorry got my concepts wrong...i thought of function calls...a function cannot be defined within a main function as it gives declaration syntax error in C and Java...but nested functions concept exists...Correct me if I am wrong...Are you sure? This action cannot be undone.