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

查看:419
本文介绍了在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的后缀就足够了?我会不会最终导致文字是PTED的128位上的一些数据模型间$ P $?

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?

推荐答案

您应该使用 &LT ; cstdint> /< stdint.h>中 ,如果你有的话。这会给你:

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

  • uint64_t中是一个无符号整数类型,是64位大小
  • UINT64_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天全站免登陆