这是用于存储(和印刷)的整数中最大的数据类型? [英] What is the largest data type for storing (and printing) an integer?
问题描述
在一个32位的系统,该系统的数据类型将存储(并因此可以打印)的最大整数的C 2它是长长
或无符号长
?是否有一个无符号长长
?而这是最precise和政治上正确的?
In C on a 32-bit system, which data type will store (and can therefore print) the largest integer? Is it long long
or unsigned long
? Is there an unsigned long long
? And which is the most precise and politically correct?
推荐答案
您的问题是有点不清楚,但还会将intmax_t
是最大的符号整数值类型(以及 uintmax_t型
是全球最大的无符号整型)。这些都是在中所定义的typedef; stdint.h>
,但如果你要打印它们,你需要< inttypes.h>
而不是和PRInMAX宏的不同值的 N 的
Your question is a bit unclear, but intmax_t
is the largest signed integer-valued type (and uintmax_t
is the largest unsigned integer type). These are typedefs defined in <stdint.h>
, but if you are printing them, you need <inttypes.h>
instead, and the PRInMAX macros for various values of n.
这篇关于这是用于存储(和印刷)的整数中最大的数据类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!