Some questions on recursion
- Why is the following recursive function unsafe?
int recurse(int v)
{
return recurse(v);
}
- Is the following version any safer?
int recurse(int v)
{
if (v>6) return recurse(v);
return v;
}
Answers to these questions.
Back to notes on recursion.