Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
给定这个定义:
typedef enum mytype { FIRST = 0, TWO = 1, Three = 2 } mytype_t;
和
somefunction(mytype_t param_one) { (some code) }
如何在函数内获取 param_one 的整数值或将其分配给整数变量?
您只需使用它 - 它已经是一个整数类型:
int x = param_one;