_C99的布尔数据类型 [英] _Bool data type of C99

查看:114
本文介绍了_C99的布尔数据类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C编程语言的C99标准将_Bool数据类型定义为另一种数据类型的宏(因为该语言无法处理类型安全的布尔值).

The C99 standard of the C programming language defines the _Bool data type as a macro for another data type (as the language isn't able to deal with a type safe boolean).

_Boolunsigned charunsigned int或其他某种数据类型的宏吗?

Is the _Bool a macro for unsigned char, unsigned int or some other data type?

推荐答案

_Bool是根据C标准的单独的整数类型. _Bool是C语言的关键字.

_Bool is a separate integere type that according to the C Standard. _Bool is a keyword of the C language.

2声明为_Bool类型的对象足够大以存储值 0和1.

2 An object declared as type _Bool is large enough to store the values 0 and 1.

_Bool是无符号整数类型.

_Bool类型和与该类型相对应的无符号整数类型 标准有符号整数类型是标准无符号整数类型.

The type _Bool and the unsigned integer types that correspond to the standard signed integer types are the standard unsigned integer types.

并且应该提到

— _Bool的等级应小于所有其他标准的等级 整数类型.

— The rank of _Bool shall be less than the rank of all other standard integer types.

这篇关于_C99的布尔数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆