Runtime exception, recursion too deep

后端 未结 12 1036
余生分开走
余生分开走 2020-12-19 04:59

I converted the pseudo-code here into C#, and have it recursively repeat 10,000 times. But I get a C# runtime error, StackOverflow Exception after 9217

12条回答
  •  情话喂你
    2020-12-19 05:28

    You cannot prevent it, the function calls itself too many times; there's a limit on how deep the call stack can get, and your function reaches it.

提交回复
热议问题