Can a function be nested?
We know that a function can be recursive but i want to know that does nested function possible in any programming language?
Replies
-
bill190Yes. 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
} -
Morningdot HabluRealy
Is it possible ?
It means a function may be defined within main function ? -
bill190Nested function defines...
#-Link-Snipped-# -
arunravindranYes a function can be nested.
-
sushant005
Is this possible in C programming or JAVA?arunravindranYes a function can be nested. -
arunravindranHi,
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...
You are reading an archived discussion.
Related Posts
India Develops world's cheapest touchscreen computing device(Tablet)
India has developed a touchscreen computing device which will cost only $35. According to a press release by India’s Press Information Bureau, the...
What do you think ' is internet affecting traditional journalism'?
Is really internet affecting their business,their publishing formats...
I have wireless sensors that can transmitt real time data back to a centralized computer where the readings are stored in a database. The data is also checked against threshold...
Hello everybody,
I am a B.E(EEE) 2010 passed out graduate and is looking for a job.But most of the job profile require some special courses. I have thought of automation,...
Hello friends,
Currently i am using ubuntu 10.04 and want to install java on it.
Can anyone have some idea which packages i have to install.
I realy need it...