关于#define key.up key.num8的问题
有一个针对按键键值的结构体
#include<stdio.h>
typedef struct{
unsigned int num0:1;
unsigned int num1:1;
unsigned int num2:1;
unsigned int num3:1;
unsigned int num4:1;
unsigned int num5:1;
unsigned int num6:1;
unsigned int num7:1;
unsigned int num8:1;
unsigned int num9:1;
}KEY_T;
KEY_T key;
#define KEYUP key.num0
int main()
{
KEYUP = 1;
while (1);
}
typedef enum
{
KEY_NUM0 = 1,
KEY_NUM1 = 2,
...
KEY_NUM9 = 512,
KEY_UP = KEY_NUM8
} key_e;