The Gateway to Computer Science Excellence
0 votes
272 views
Will recursion work correctly in a language with static allocation of all variables? Explain.
in Compiler Design by Boss (30.8k points) | 272 views

1 Answer

+4 votes

Recursion can not be used for static variables since the memory for static variables are allocated only once . so if we use recursion, then it  may give incorrect result . Generally, we do not want such things when implementing recursion.

For detailed explanation, refer http://stackoverflow.com/questions/10290527/why-do-static-variables-not-allow-recursion

by Junior (575 points)
edited by

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,295 answers
198,261 comments
104,971 users