Discuss the scope and lifetime of local and global variables
Answers
Answered by
0
Answer:
Global scope : When variable is defined outside all functions. It is then available to all the functions of the program and all the blocks program contains.
Local scope : When variable is defined inside a function or a block, then it is locally accessible within the block and hence it is a local variable.
Answered by
0
Explanation:
Global scope : When variable is defined outside all functions. It is then available to all the functions of the program and all the blocks program contains. Local scope : When variable is defined inside a function or a block, then it is locally accessible within the block and hence it is a local variable.
Similar questions