什么是默认整数值? [英] what are default integer values?
问题描述
我读的地方,默认浮点值,如 1.2
是双击
不是浮动
。结果
那么,什么是喜欢 6
默认整数值,它们是短
, INT
或长
?
I read somewhere that default floating point values like 1.2
are double
not float
.
So what are default integer values like 6
, are they short
, int
or long
?
推荐答案
在基地10定整文字的类型是以下列表中的第一种类型中,它们的价值可以适合:
The type of integer literals given in base 10 is the first type in the following list in which their value can fit:
-
INT
-
长整型
-
得到long long int
int
long int
long long int
有关八进制和十六进制文字,符号类型将被视为好,按以下顺序:
For octal and hexadecimal literals, unsigned types will be considered as well, in the following order:
-
INT
-
unsigned int类型
-
长整型
-
unsigned long int类型
-
得到long long int
-
无符号长long int类型
int
unsigned int
long int
unsigned long int
long long int
unsigned long long int
您可以指定一个 U
后缀强制无符号
类型,一个→
后缀强制长
或长长
或 LL
后缀强制长长
。
You can specify a u
suffix to force unsigned
types, an l
suffix to force long
or long long
, or an ll
suffix to force long long
.
参考:C99,6.4.4.1p5
Reference: C99, 6.4.4.1p5
这篇关于什么是默认整数值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!