C语言 1L是什么意思?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14103738/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What does 1L mean?
提问by JeremyL
Possible Duplicate:
What does “-1L” mean in C?
可能的重复:
C 中的“-1L”是什么意思?
What does "0L", "1L" mean in C ? How is it different from "0" and "1" ? Is there other literals than "L" with similar function in C ?
“0L”、“1L”在 C 中是什么意思?它与“0”和“1”有何不同?在 C 中是否有除“L”之外具有类似功能的其他文字?
回答by md5
It an integer constant which has long inttype instead of int.
它是一个整数常量,它具有long int类型而不是int.
C11, § 6.4.4.1 Integer constants #1
long-suffix: one of
lL
C11, § 6.4.4.1 整数常量 #1
长后缀:之一
lL
回答by MOHAMED
The 0Lmeans 0 in longformat.
该0L装置在0long格式。
回答by Jerry Coffin
The Lsuffix makes it a longinstead of an intliteral -- it can be applied to essentially any number (though if the number is large enough that it won't fit in an int, it will be a longwhether you include the suffix or not).
该L后缀使得它long,而不是int字面-它可以适用于几乎任何数字(不过,如果数量足够大,它不适合在int,这将是一个long是否包含后缀或没有)。
回答by pmg
In the C99 Standard(PDF of draft), the suffixes described are in 6.4.4.1 (integer suffixes) and 6.4.4.2 (floating suffixes)
在C99 标准(草案 PDF)中,描述的后缀在 6.4.4.1(整数后缀)和 6.4.4.2(浮动后缀)
Integer suffixes are u(unsigned), l(lowercase L) (long), ll(long long), ul(unsigned long), ull(unsigned long long), lu(long unsigned), llu(long long unsigned) and uppercase versions.
整数后缀是u( unsigned)、l(小写 L) ( long)、ll( long long)、ul( unsigned long)、ull( unsigned long long)、lu( long unsigned)、llu( long long unsigned) 和大写版本。
Floating suffixes are f(float) and l(long double) and uppercase versions.
浮动后缀是f( float) 和l( long double) 和大写版本。

