注册 登录
编程论坛 新人交流区

ifndef的用法?

Cking 发布于 2007-10-15 22:55, 452 次点击
#ifndef _TEST_H ------1
#define _TEST_H ------2
#ifdef __cplusplus ----3
extern "C" { --------4
#endif --------5
/*...*/
#ifdef __cplusplus --------6
}
#endif --------7
#endif /* _TEST_H */ --------8

以上的8个地方是什么意思啊?
我在OPNET里面看见这个,从来没有见过宏定义的这种用法?
谢谢啊
1 回复
#2
yoapple2007-10-15 23:11

这是条件编译的内容.那意思是说:1:如果没有定义了_TEST_H,则编译以下内容.2:定义_TEST_H.3:如果定义了__cplusplus ,则编译以下内容.后面的自己去看书.

1