3 votes 3 votes When a function is recursively called, all automatic variables : are initialized during each execution of the function are retained from the last execution are maintained in a stack are ignored Programming in C runtime-environment + – Sanjay Sharma asked Jun 9, 2016 Sanjay Sharma 12.8k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 5 votes 5 votes When a function is recursively called, all automatic variables are initialized during each execution of the function. ManojK answered Jun 9, 2016 • selected Jun 9, 2016 by Arjun ManojK comment Share Follow See all 10 Comments See all 10 10 Comments reply Sourabh Kumar commented Jun 10, 2016 reply Follow Share but the variable stored in stack on each function call 0 votes 0 votes ManojK commented Jun 10, 2016 reply Follow Share so what do you want to say ? 0 votes 0 votes Sourabh Kumar commented Jun 10, 2016 reply Follow Share both a and c are correct 2 votes 2 votes ManojK commented Jun 10, 2016 reply Follow Share c is not sufficient for answer . Understand the qus properly . 0 votes 0 votes himanich commented Jul 16, 2016 reply Follow Share @manojk sir what does it mean by automatic variable here. Are they not maintained in stack ? 1 votes 1 votes ManojK commented Jul 16, 2016 reply Follow Share when a call ends.then what will happen. 0 votes 0 votes himanich commented Jul 16, 2016 reply Follow Share a recursive call again . 0 votes 0 votes ManojK commented Jul 16, 2016 i edited by ManojK Jul 16, 2016 reply Follow Share See dear i meant here when call starts all the automatic variable which are initialized in stack and de-allocated when the call ends or you can say A new copy, with its value initially undefined, is made for each new call. .They are not maintained after the call ends. 0 votes 0 votes himanich commented Jul 16, 2016 reply Follow Share I agree with your statement ,but I don't understand the meaning of automatic variables .are they special kind of variables ? 0 votes 0 votes ManojK commented Jul 16, 2016 reply Follow Share Variable are named differently as a point of occurrence in the program.So automatic variable is used here because of they are occurring inside function . For more info you can check here Variable 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes All the local variables that are bounf to executes in its activation records will need freash allocation each and every time. So local variables inside the each activation records needs freash allocation. Paras Nath answered Oct 15, 2016 Paras Nath comment Share Follow See 1 comment See all 1 1 comment reply Ram Swaroop commented Aug 18, 2019 reply Follow Share If variable is static it retained it's updated value in different function calls. 0 votes 0 votes Please log in or register to add a comment.