Difference between _Bool and bool types in C?

前端 未结 2 590
一个人的身影
一个人的身影 2020-11-29 06:34

Can anyone explain me what is the difference between the _Bool and bool data type in C?

For example:

 _Bool x = 1;
  bool y =         


        
2条回答
  •  爱一瞬间的悲伤
    2020-11-29 06:54

    There is no difference.

    bool is a macro that expands to _Bool in stdbool.h.

    And true is a macro that expands to 1 in stdbool.h

提交回复
热议问题