LL是什么意思? [英] What does LL mean?

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

问题描述

在标准中的任何地方定义 LL

Is LL defined anywhere in the standard (hard term to come by)?

ideone 接受代码

int main()
{
    std::cout << sizeof(0LL) << std::endl;
    std::cout << sizeof(0);
}

并列印

8
4

推荐答案

它在C ++ 11标准的2.14.2节中规定:

It is specified in Paragraph 2.14.2 of the C++11 Standard:


[...]

[...]

长长后缀

ll LL


第2.14.2 / 2段,特别是表6,十进制,八进制和十六进制常量的后缀,以及给定的类型。

Paragraph 2.14.2/2, and in particular Table 6, goes on specifying the meaning of the suffix for decimal, octal, and hexadecimal constants, and the types they are given.

由于 0 是八进制文字, 0LL long long int

Since 0 is an octal literal, the type of 0LL is long long int:

#include <type_traits>

int main()
{
    // Won't fire
    static_assert(std::is_same<decltype(0LL), long long int>::value, "Ouch!");
}

这篇关于LL是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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