在数字文字ULL后缀

问题描述:

我碰到一些code运行是这样的:

I've run across some code like this:

line += addr & 0x3fULL;

显然,U和L不是十六进制数字。我猜的'ULL'在这十六进制数字字面意思是无符号长隆结束 - 我是正确的? (这样的事情是非常困难的谷歌)如果是这样,那么这是某种形式的后缀修改器上的数字?

Obviously, 'U' and 'L' are not hex digits. I'm guessing that the 'ULL' at the end of that hex numeric literal means "Unsigned Long Long" - am I correct? (this sort of thing is very difficult to google) if so then this is some sort of suffix modifier on the number?

GCC 手动

ISO C99支持对至少64位宽的整数数据类型,作为扩展GCC支持其C90模式和C ++。简单的写得到long long int 的有符号整数,或无符号长long int类型一个无符号整数。为了使键入得到long long int 的整型常量,后缀 LL 添加到整数。为了让类型的整型常量无符号长long int类型,后缀 ULL 添加到整数。

ISO C99 supports data types for integers that are at least 64 bits wide, and as an extension GCC supports them in C90 mode and in C++. Simply write long long int for a signed integer, or unsigned long long int for an unsigned integer. To make an integer constant of type long long int, add the suffix LL to the integer. To make an integer constant of type unsigned long long int, add the suffix ULL to the integer.