在数字文字ULL后缀 [英] ULL suffix on a numeric literal

查看:616
本文介绍了在数字文字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.

这篇关于在数字文字ULL后缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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