Find limit of recursion: Difference between revisions

m
(C)
Line 83:
}</lang>
 
Segmentation fault occurs when i is 523756. (This was checked debugging with gdb rather than waiting the output: the printf line for the test was commented). It must be noted that the recursion limit depends on how many parameters are passed onto the stack. E.g. adding a fake double argument to <code>recurse</code>, the limit is reached at <code>i == 261803</code>. The limit depends on the stack size; so if each call to the function uses more stack space, the recursion limit becomes smaller.
 
=={{header|Python}}==