Gho*_*ing -3 c recursion function
可能重复:
此代码中发生了什么?
我有一个包含递归函数的代码.我在递归上浪费了很多时间,但我仍然无法得到它,真的:
#include<stdio.h>
count(int);
main(){
int x=10,z;
z=count(x);
}
count(int m){
if(m>0)
return count(m-1);
}
Run Code Online (Sandbox Code Playgroud)
当count第一次使用参数调用时10,它满足条件并且递归开始.当函数调用自身时会发生什么?我不懂.该陈述return count(m-1)是什么意思?它在哪里转移控制?