在64位数据模型上指定64位无符号整数字面值 [英] Specifying 64-bit unsigned integer literals on 64-bit data models

查看:342
本文介绍了在64位数据模型上指定64位无符号整数字面值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于有各种类型的64位数据模型(LLP64 / IL32P64,LP64 / I32LP64,ILP64,SILP64),指定64位无符号整数文字的标准一致方式是什么?

As there are various types of 64-bit data models (LLP64/IL32P64, LP64/I32LP64, ILP64, SILP64), what is the standard conforming way of specifying 64-bit unsigned integer literals?

指定ULL的后缀是否足够?或者,我最终会导致字面量在一些数据模型上被解释为128位?

Would specifying the suffix of ULL be sufficient? Or would I end up causing the literal to be interpreted as 128-bit on some data models?

推荐答案

c $ c> < cstdint> /< stdint.h> ,如果你有它。这将给你:

You should use <cstdint> / <stdint.h>, if you have it. This will give you:


  • uint64_t 是一个无符号整数类型, c> 是一个用于创建 uint64_t
  • uint64_t is an unsigned integer type which is 64 bits in size
  • UINT64_C() is a macro for creating constants of the type uint64_t, by having the macro append the proper suffix.

这篇关于在64位数据模型上指定64位无符号整数字面值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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