On this pageC1901switch表达式不得是基本布尔类型Category: RequiredDecidability: DecidableScope: Single Translation Unit依据C语言标准规定 switch 语句的控制表达式是整数类型。因为用于实现布尔值的是整数类型,因此可能出现用布尔表达式控制 switch 语句的情况。而这时使用 if-else 更加合适。登录查看完整文章