gpt4 book ai didi

C99 boolean 数据类型?

转载 作者:太空狗 更新时间:2023-10-29 16:15:18 25 4
gpt4 key购买 nike

什么是 C99 boolean 数据类型以及如何使用它?

最佳答案

包括 <stdbool.h> 标题

#include <stdbool.h>

int main(void){
bool b = false;
}

truefalse扩展到 10分别。

7.16 boolean 类型和值 < stdbool.h >

  • 1 The header <stdbool.h> defines four macros.
  • 2 The macro
    • bool expands to _Bool.
  • 3 The remaining three macros are suitable for use in #if preprocessing directives. They are
    • true : which expands to the integer constant 1,
    • false: which expands to the integer constant 0, and
    • __bool_true_false_are_defined which expands to the integer constant 1.
  • 4 Notwithstanding the provisions of 7.1.3, a program may undefine and perhaps then redefine the macros bool, true, and false.

关于C99 boolean 数据类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4767923/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com