我创建了一个枚举wearState,然后将wearState作为两个变量的类型。但是当我尝试用“||”将它们置于 if 条件时 或“&&”,它不起作用。它说:“错误:二元运算符‘||’的操作数类型错误 ”
enum wearState {
WRIST_MOVE,
WRIST_IMMOBILE,
BELT_NECK_MOVE,
BELT_NECK_IMMOBILE,
OTHER_IMMOBILE_STATE;
}
enum chargingState {
YES,
NO,
}
wearState lastState;
wearState currentState;
chargingState lastStateCharging;
chargingState currentStateCharging;
if (((currentState = wearState.BELT_NECK_IMMOBILE) || (currentState = wearState.WRIST_IMMOBILE)) &&
(lastStateCharging = chargingState.NO)) {
/* .... */
}
摇曳的蔷薇
相关分类