免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123下一页
最近访问板块 发新帖
查看: 18772 | 回复: 20
打印 上一主题 下一主题

C语言中有bool类型吗? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-07-20 16:22 |只看该作者 |倒序浏览
C语言中有bool类型吗?
为什么在aix下,定义bool型 编译可以通过并可以使用?
如:
bool ok;
static void Mm(bool *a, const bool *b, int len);

论坛徽章:
0
2 [报告]
发表于 2009-07-20 16:23 |只看该作者
搜了一下,说头系统文件里定义了
#include   <stdbool.h>  

不明白什么意思?

论坛徽章:
0
3 [报告]
发表于 2009-07-20 16:32 |只看该作者
c99提供

论坛徽章:
0
4 [报告]
发表于 2009-07-20 23:46 |只看该作者
AIX那个xlc支持C99不?

论坛徽章:
80
20周年集字徽章-庆
日期:2020-10-28 14:09:1215-16赛季CBA联赛之北京
日期:2020-10-28 13:32:5315-16赛季CBA联赛之北控
日期:2020-10-28 13:32:4815-16赛季CBA联赛之天津
日期:2020-10-28 13:13:35黑曼巴
日期:2020-10-28 12:29:1520周年集字徽章-周	
日期:2020-10-31 15:10:0720周年集字徽章-20	
日期:2020-10-31 15:10:07ChinaUnix元老
日期:2015-09-29 11:56:3020周年集字徽章-年
日期:2020-10-28 14:14:56
5 [报告]
发表于 2009-07-21 09:31 |只看该作者
c好像没有吧

论坛徽章:
0
6 [报告]
发表于 2009-07-21 09:40 |只看该作者

回复 #1 zouhu_cn 的帖子

o,1不就可以代表bool吗?
最多再来个宏定义吧

论坛徽章:
0
7 [报告]
发表于 2009-07-21 09:46 |只看该作者
C99
Boolean type
Note that, although _Bool is technically an integer type, conversion to _Bool does not always
work the same as conversion to other integer types. Consider, for example, that the expression
(_Bool)0.5 evaluates to 1, whereas (int)0.5 evaluates to 0. The first result is correct: it
simply says that 0.5 is non-zero; but it may be somewhat counter-intuitive unless a _Bool is
thought of as a “truth value” rather than as a one-bit integer.

论坛徽章:
0
8 [报告]
发表于 2009-07-21 11:10 |只看该作者
用的是cc编译器。

论坛徽章:
1
黑曼巴
日期:2020-02-27 22:54:26
9 [报告]
发表于 2009-07-21 11:19 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
10 [报告]
发表于 2009-07-21 11:46 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP