什么是默认整数值? [英] what are default integer values?

查看:357
本文介绍了什么是默认整数值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读的地方,默认浮点值,如 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屋!

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