Sorry if this is the wrong site, but let's imagine a function (C#):
public int Increment(int i)
{
int j = i;
if (j++ < Math.Pow(10, 12)) j = Increment(j);
return j;
}
The function is pretty useless, but it's just an example. I would imagine that the final recursion return value of the self recursion "loop" would pass the result back down through each recursive function, returning each method to the previous recursion, before finally returning back to the initial function call, returning to the caller of the function.
My question is how many recursions we can have, and what causes that limit? Thanks.