布尔值#
布尔变量(bool)的取值:布尔字面值常量。布尔字面值常量的取值为 true (整型值为 1) 和 false (整型值为 0)。
布尔变量常用于表示逻辑运算的结果。
int a {20};
int b {30};
bool c {a == b};
c
false
b = 20;
bool c1 {a == b};
c1
true
true
true
false
false
布尔变量(bool)的取值:布尔字面值常量。布尔字面值常量的取值为 true (整型值为 1) 和 false (整型值为 0)。
布尔变量常用于表示逻辑运算的结果。
int a {20};
int b {30};
bool c {a == b};
c
false
b = 20;
bool c1 {a == b};
c1
true
true
true
false
false