布尔类型 布尔类型 bool (逻辑型) 真 == true == 1 假 == false == 0 如果调用布尔类型,需要调用"stdbool.h"头文件 #include <stdbool.h> 示例 #include <stdio.h> #include <stdbool.h> int main() { bool b = true; printf("%d \n",b); //布尔类型存储的值就是一个整数 b = false; printf("%d \n",b); //调试出来就是0 return 0; }