The difficulty with tail recursion in these languages is that their implementations use the stack to store procedure arguments and local variables, as well as return addresses.
There are no function calls in machine language, so function calls are translated into
- Putting arguments on the call stack
- push stack return address
- go to the body of the routine you want to call
- when the routine completes, it returns to the return address that we pushed onto the stack earlier
- arguments are removed from the stack
" ", , 5 ( ). C, , . , printf ( ), , , "" - , ( ). , , , , TCO.