1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#include <stdio.h>
typedef enum {
RT_NONE, // 默认值为0
RT_A, // 默认值为1
RT_F, // 默认值为2
RT_B, // 默认值为3
RT_C, // 默认值为4
RT_D, // 默认值为5
RT_E, // 默认值为6
RT_H, // 默认值为7
RT_L, // 默认值为8
RT_AF, // 默认值为9
RT_BC, // 默认值为10
RT_DE, // 默认值为11
RT_HL, // 默认值为12
RT_SP, // 默认值为13
RT_PC // 默认值为14
} reg_type;
typedef struct {
reg_type reg;
} MyStruct;
int main() {
MyStruct s;
printf("Default value of reg: %d\n", s.reg); // 输出0,即RT_NONE
return 0;
}
|