Bloomberg LP Interview Question
Software Engineer / DevelopersIt means that there is a dynamic (run-time) stack of scopes and binding of any variable is looked for from the top to the bottom of the stack.
In C++ there is no dynamic scoping for variables (at least in a straightforward manner, but if there is a really subtle way of doing it, I don't know).
Static scoping is scoping that is defined at compile time. This is the most commonly supported mode of scoping. Lexical scoping is a form of static scoping, where the scoping is defined by where a particular item is placed in the program source.
Dynamic scoping changes at run time. A typical form of dynamic scoping is where a caller's local variables are exposed directly to a callee. Hence, the availability of these variables is dependent on how the function is called.
What does dynamic scoping means?
- DashDash July 15, 2010