【发布时间】:2023-01-19 23:00:00
【问题描述】:
我尝试在 C 中使用 #define 预处理器指令,如下所示:
/* This part is okay */
#define TEST1 (uint8)0x00
#define TEST2 (uint8)0x20
/* Here is where the problem occurs */
#define L2_PORT_USB_SET ( TEST1 ) /* comment comes here */
#define L2_SUBS_WB ( TEST1 | (uint8)0x01 ) /* another comment comes here */
我做错了什么?
【问题讨论】:
-
我不认为这个错误会在定义宏时发生,它会在使用宏时发生。
标签: c c-preprocessor