c 语言 整数布尔值_C中的布尔值

c 语言 整数布尔值C originally did not have native support for boolean values. C最初不支持布尔值。 C99, the version of C released in 1999⁄2000, introduced a boolean type. C99是1999年 / 2000年发布的C版本,引入了布尔类型。 To use ...
摘要由CSDN通过智能技术生成

c 语言 整数布尔值

C originally did not have native support for boolean values.

C最初不支持布尔值。

C99, the version of C released in 19992000, introduced a boolean type.

C99是1999年 / 2000年发布的C版本,引入了布尔类型。

To use it, however, you need to import a header file, so I’m not sure we can technically call it “native”. Anyway, we do have a bool type.

但是,要使用它,您需要导入头文件,因此我不确定我们在技术上可以称其为“本机”。 无论如何,我们确实有bool类型。

You can use it like this:

您可以像这样使用它:

#include <stdio.h>
#include <stdbool.h>

int main(void) {
  bool isDone = true;
  if (isDone) {
    printf("done\n");
  }

  isDone
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值