Limit recursive calls in C++ (about 5000)?

前端 未结 3 666
独厮守ぢ
独厮守ぢ 2021-01-05 23:03

In order to know the limit of the recursive calls in C++ i tried this function !

void recurse ( int count ) // Each call gets its own count
{
printf(\"%d\\n\         


        
3条回答
  •  独厮守ぢ
    2021-01-05 23:44

    The stack size is dependent on your environment.

    In *NIX for instance, you can modify the stack size in the environment, then run your program and the result will be different.

    In Windows, you can change it this way (source):

    $ editbin /STACK:reserve[,commit] program.exe
    

提交回复
热议问题