1.宏定义数组成员,举例如下:
unsigned char testArray[10]
#define test(x) testArray[x] // 调用test(x) 即代表testArray[x]
2.宏定义结构图数组中的数组成员,举例如下:
typedef struct
{
u32 update_addr;
u8* update_buf;
u16 update_length;
u16 _test[10];
}Update_disp_Def;
Update_disp_Def Update_disp_Buf[500];
#define test(x,y) Update_disp_Buf[x]._test[y] // 调用test(x,y) 即代表Update_disp_Buf[x]._test[y]
备注:宏定义中不能出现[],可以使用().