Int fact (int n, int num) { If (n & lt;=0) return num; Return fact (n - 1, n + num); }
Int main () { Int c=1; C=fact (10000, 0); STD: : cout & lt; }
After 0 on x00992389 (located in the study. Exe) caused by abnormal: 0 xc00000fd: Stack overflow (x00882f94 x00000001 parameters: 0, 0), Why the tail call stack overflow will
CodePudding user response:
Whenever calls the function, before this function will be the code before address parameters such as (that is, call point) into the stack, such as the called function will address a stack, program according to the data return calls, if the number of recursive calls too much, will not only into the stack stack, then the stack is destroyed, pressure,,