Chapter 3: Problem 10
What is a local variable? How is access to a local variable restricted?
Short Answer
Expert verified
#Short_Answer#
A local variable is a variable declared inside a function or any block of code and can only be accessed within that specific scope. It is limited in scope and visibility, meaning it cannot be accessed from outside the function or block where it is declared. Consequently, trying to access a local variable outside its defined scope will lead to a compilation error.