标题:高手们过来解释一下条件编译!
取消只看楼主
cpp
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2004-9-3
 问题点数:0 回复次数:1 
高手们过来解释一下条件编译!

在书上看了关于条件编译的一节内容

但是由于书本的章幅有限,未解释得很明白

敬请高手们过来帮我解释一下(越具体越好,越基本越好)

拜托了!!

搜索更多相关主题的帖子: 条件 编译 解释 
2004-10-05 23:01
cpp
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2004-9-3
得分:0 

版主帮忙解释一下下面这个程序吧!

这里好象还涉及到了递归函数,这使我赶到非常迷惑。

望能指点迷津。

# include <iostream.h> # define DEBUG

int factorial( int num ) { if(num == 0) return 1; else { # if defined(DEBUG) static i; cout<<"call times:"<<++i<<",num = "<<num<<endl; # endif return factorial(num - 1) * num; } } void main() { int number; cout<<"Enter a integer : "; cin>>number; cout<<"The tactorial number : "<<factorial(number)<<endl; }

2004-10-11 18:03



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-6070-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.086439 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved