when we declare function1 in function2 then other function(other than function2) are not allowed to call function1. but when we overload function1 then we can call it anywhere (in any function) why?
1
Expert's answer
2014-02-06T12:14:29-0500
Dear Gaurav, There is a concept of "scope" in the programming. When you declare function2 inside of function1 like this function1 { function2 {
} } it can be accessed from function1 only as it was declared in its scope. If you want to use function2 in other functions you will have to declare it in the global scope, like this: function1 { } function2 { } I this case function1 and function2 can be accessed from any other function.
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment