Chinaunix

标题: 问个白痴问题 [打印本页]

作者: gigabyte    时间: 2008-08-26 17:35
标题: 问个白痴问题
linux下的true与false在哪个头文件中定义的啊?
作者: happy_fish100    时间: 2008-08-26 17:50
标题: 回复 #1 gigabyte 的帖子
c中,true和false不是标准的,需要自己定义。形如:

#ifndef true
typedef char  bool;
#define true  1
#define false 0
#endif
作者: gigabyte    时间: 2008-08-26 17:50
为什么我的/usr/include 目录下没有stdbool.h文件:wink:
作者: gigabyte    时间: 2008-08-26 17:51
原帖由 happy_fish100 于 2008-8-26 17:50 发表
c中,true和false不是标准的,需要自己定义。形如:

#ifndef true
typedef char  bool;
#define true  1
#define false 0
#endif



谢谢你
作者: fox000002    时间: 2008-08-26 19:02
c 语言又何必执着于 true 或 false
作者: gawk    时间: 2008-08-26 20:43
c中好像没有bool类型
作者: shmild    时间: 2008-08-26 20:58
原帖由 gawk 于 2008-8-26 20:43 发表
c中好像没有bool类型

c99有的




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2