enum eTaskType{ TYPE_UNKOWN, TYPE_ADD, };
or
typedef enum eTaskType{ TYPE_UNKOWN, TYPE_ADD, }TaskType;
假如有上述枚举,或者其他定义方法,如何才能通过枚举变量或枚举类型访问成员(通过. -> ::等方式),比如: TaskType.TYPE_ADD
认证0级讲师
Whether it is eTaskType or TaskType, you can write directly like this:
eTaskType
TaskType
eTaskType::TYPE_UNKNOWN
TaskType::TYPE_UNKNOWN
Whether it is
eTaskType
orTaskType
, you can write directly like this:eTaskType::TYPE_UNKNOWN
TaskType::TYPE_UNKNOWN