C语言中的布尔值

当我们把非0值赋给布尔类型,会变成1

例如

#include <stdio.h>
 int main()
 {
    bool a = -1;
    if (a==1)
    printf("true");
 }

结果为true,证明a是等于1的

原文地址:https://www.cnblogs.com/dongwenbo/p/3817780.html