2011年3月31日
摘要: #include<stdio.h>fun(int x){ if(x/2>0) fun(x/2); printf("%d ",x);}void main(){ fun(6); printf("\n");}试着分析下函数输出,结果是1 3 6。递归函数在每次被调用时都将创建自己的堆栈,一层一层向上返回。类似与入栈与出栈。 阅读全文
posted @ 2011-03-31 15:08 rfcff 阅读(120) 评论(0) 推荐(0) 编辑