If an automatic variable is created and then a function is called then ________________

Phương Quyên

New member
If an automatic variable is created and then a function is called then ________________
A. The automatic variable created gets destroyed
B. The automatic variable doesn’t get destroyed
C. The automatic variable may or may not get destroyed
D. The automatic variable can’t be used in this case
 
Answer: b
Explanation: The automatic variables are saved till the called function gets executed. This is done so as to ensure that the program can continue its execution after the called function is returned. The automatic variables gets destroyed only if those go out of scope.
 

Tìm kiếm

Back
Top