Using boolean values in C

前端 未结 18 1864
被撕碎了的回忆
被撕碎了的回忆 2020-11-22 12:51

C doesn\'t have any built-in boolean types. What\'s the best way to use them in C?

18条回答
  •  抹茶落季
    2020-11-22 12:59

    If you are using a C99 compiler it has built-in support for bool types:

    #include 
    int main()
    {
      bool b = false;
      b = true;
    }
    

    http://en.wikipedia.org/wiki/Boolean_data_type

提交回复
热议问题