本文介绍了是C ++ 11的长长真的至少64位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它说和,类型 long long 的长度至少与 int 不小于64位。我一直在看看C ++ 11标准§3.9.1基本类型部分,我找不到任何参考64位。我可以找到的是它至少与 long int 一样长,这至少等于 int 。该标准将 long long 列为标准整数类型,而不是扩展这个断言 long long 至少保存64位是真的。如果是,它在哪里说明?
请注意,我只是谈论C ++ 11标准 long long

解决方案

C ++标准引用了C标准,参见[c.limits]。在< climits> 中定义与C的< limits相同含义的 LLONG_MAX h> LLONG_MAX 。这是C必须说的:

必须能够表示值 9223372036854775807 的签名类型需要64位或更多位。


It says here and here that type long long is at least as long as an int and has no fewer than 64 bits. I have been looking at the C++11 standard §3.9.1 Fundamental Types section and I cannot find any reference to 64 bits. All I can find is that it is at least as long at long int, which is at least as long as int. The standard lists long long as a standard integer type, as opposed to an extended one, so I am wondering whether this assertion that long long holds at least 64 bits is true. And if it is, where is it stated?Please note that I am talking about C++11 standard long long only.

解决方案

The C++ standard references the C standard for this, see [c.limits]. LLONG_MAX is defined in <climits> with the same meaning as C's <limits.h>'s LLONG_MAX. And this is what C has to say:

A signed type that must be capable of representing the value 9223372036854775807 requires 64 bits or more.

这篇关于是C ++ 11的长长真的至少64位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 08:32