【发布时间】:2012-04-02 15:42:13
【问题描述】:
使用普通的 C 预处理器宏,是否可以创建如下内容:
INIT_BASE(0x100) // init starting number
#define BASE_A GET_NEXT_BASE // equivalent to #define BASE_A 0x101
#define BASE_B GET_NEXT_BASE // 0x102
#define BASE_C GET_NEXT_BASE // 0x103
【问题讨论】:
-
为什么需要一个预处理器#define?为什么不只是一个枚举?
标签: c macros c-preprocessor