C语言有bool类型吗

来源:互联网 发布:淘宝华黎 编辑:程序博客网 时间:2024/05/16 12:09

    我到今天终于发现原来C语言是没有bool类型的,汗死……原来C++中才有,不过C99中新增的_Bool关键字可以表示布尔类型。

C99关键字(ISO/IEC 9899:1999)
auto
break
case
char
const
continue
default
do
double
else
enum
extern
float
for
goto
if
inline
int
long
register
restrict
return
short
signed
sizeof
static
struct
switch
typedef
union
unsigned
void
volatile
while
_Bool
_Complex
_Imaginary

 

ISO/IEC 14882(C++标准关键字)
Second edition 2003-10-15

asm do  if  return typedef
auto double inline  short typeid
bool dynamic_cast int  signed typename
break else  long  sizeof union
case enum  mutable  static unsigned
catch explicit namespace  static_cast using
char export new  struct virtual
class extern  operator  switch void
const false  private  template volatile
const_cast float protected this wchar_t
continue for  public  throw  while
default friend  register  true
delete goto  reinterpret_cast try

 

不过目前大部分编译器、教材(包括谭浩强的C语言)都在C89的基础上,据说GCC支持大部分C99标准,而Microsoft则并不感兴趣。_Bool在最新的VS2010上也不支持,同样C99说变量定义并不要求在句块开头,VS2010仍然不支持!但它们却都被GCC支持。

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 4g手机网卡怎么办 电信3g网速不好怎么办 手机指纹锁打不开了怎么办 随身wifi坏了怎么办 华为手机耗流量怎么办 华为的卡槽坏了怎么办 手机内存小了怎么办 华为平板停止运行怎么办 华为p6一直黑屏怎么办 华为手机root卡重启怎么办 华为手机变砖怎么办 华为手机丢了怎么办? 蓝牙耳机不闪烁怎么办 金立手机打不开怎么办 华为蓝牙不能用怎么办 iphone蓝牙坏了怎么办 苹果蓝牙坏了怎么办 苹果x蓝牙连不上怎么办 手机耳机槽松了怎么办 蓝牙连接不上怎么办 蓝牙开不了机怎么办 蓝牙耳机听不了怎么办 路虎车门打不开怎么办 蓝牙连接声音小怎么办 手机丢在高铁上怎么办 电信卡注销欠费怎么办 手机和卡都丢了怎么办 老干妈打不开盖子怎么办 苹果键盘电池仓打不开怎么办 苏泊尔电压力锅打不开盖子怎么办 honorv9声音太小怎么办 异地手机卡丢了怎么办 中国移动卡丢了怎么办 mate8麦克风坏了怎么办 qq空间被禁赞了怎么办 苹果老耳机模式怎么办 华为手机无声音怎么办 华为手机声音不正常怎么办 带耳机不能说话怎么办 耳机说话没声音怎么办 手机耳机说话没声音怎么办