Sunday, June 17, 2007

Macro in C/C++, updateing

>define()
This is used in #if, #elif #endif preprocess sentence, and #if define(x) is equle to #ifdef x, #if !define(x) is equle to #ifndef x.
but define() is more powerful while check mutiply Macro, as it can be join with ||, &&, and !.eg:
#if defined(__STDC__) || defined(__cplusplus)
...
#endif


> __STDC__, __cplusplus
These macros are not forced by standards, but a complete implement always surports to indicate ISO C or C++ surport.

0 评论: