Void (A) {int A=1; (B); }
Void (B) {int B=1; (A); }
In the process of the call, please. A, b will be released? Or will produce many of the local variable a, b?
Thank you!
CodePudding user response:
Is released, the local variables of type int is reserved space in the stack,See the corresponding assembly code will thoroughly understand,
The variable usually includes function arguments and function in the stack declared temporary variables,
The basic variables of the stack exit its scope, who did not perform a piece of code to release/destroy/destructor of memory, it occupies only is no one to stay at the top of the current stack of several legacy can be covered by subsequent pressure stack, useless data,
And the class variables in the stack exit its scope, will automatically perform its destructor,...
CodePudding user response:
Local variables at the end of the function of memory automatically releaseCodePudding user response:
The