Using boolean values in C

前端 未结 18 1834
被撕碎了的回忆
被撕碎了的回忆 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 13:03

    You can use a char, or another small number container for it.

    Pseudo-code

    #define TRUE  1
    #define FALSE 0
    
    char bValue = TRUE;
    

提交回复
热议问题