本文介绍了中int8_t,int_least8_t和int_fast8_t的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有什么INT类型之间的中int8_t
, int_least8_t
和 int_fast8_t 区别code>?
What is the difference between the int types int8_t
, int_least8_t
and int_fast8_t
?
推荐答案
的差额,C99标准卡尔Norum时引述的部分定义。但它可能是有一个例子是有用的。
The difference is defined in the sections of the C99 standard that Carl Norum quoted. But it may be useful to have an example.
假设你有一个36位系统中的C编译器,以字符
= 9位,短
= 18位, INT
= 36位,而长
= 72位。然后
Suppose you have a C compiler for a 36-bit system, with char
= 9 bits, short
= 18 bits, int
= 36 bits, and long
= 72 bits. Then
-
中int8_t
的不存在的,因为没有办法满足其的究竟的8值位的约束没有填充。 -
int_least8_t
是字符
的一个typedef。不是的短
或INT
,因为标准要求的最小的类型至少有8个位。 -
int_fast8_t
可以是任何东西。这很可能是INT
的一个typedef如果本地大小被认为是快。
int8_t
does not exist, because there is no way to satisfy the constraint of having exactly 8 value bits with no padding.int_least8_t
is a typedef ofchar
. NOT ofshort
orint
, because the standard requires the smallest type with at least 8 bits.int_fast8_t
can be anything. It's likely to be a typedef ofint
if the "native" size is considered to be "fast".
这篇关于中int8_t,int_least8_t和int_fast8_t的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!