|
蓝森林 http://www.lslnet.com 2006年6月6日 10:18
#if 0 起什么作用?
[code]
33 #if 0
34 #ifndef lint
35 static char const copyright[] =
36 "@(#) Copyright (c) 1989, 1993\n\
37 The Regents of the University of California. All rights reserved.\n";
38 #endif
39 #endif
40
41 #ifndef lint
42 #if 0
43 static char sccsid[] = "@(#)cat.c 8.2 (Berkeley) 4/27/95";
44 #endif
45 #endif
...................
[/code]
这代码中的#if 0起什么作用?包含在#if 0 与#endif之间的代码在什么情况下会起作用?:em14: |
#if 0的作用是注释。
当改成#if 1的时候就变成了取消注释。
这样在注释一大段代码的时候非常有效。 |
-->
哦,明白了!
谢谢!:D |
这是条件编译,你可以参考一下《C程序设计语言》第二版附录A的第209页。 |
-->
谢谢!我去看看。
我是觉得既然是#if 0 了,那之间的代码就不会处理了,那还有什么用呢?:lol: |
你总不至于不要的代码就删掉吧,先用#if 0注释了,需要的时候#if 1
多好◎◎ |
用于把代码卡擦掉.... |
学到了! |
| |