sizeof (int) == sizeof (void*)? [英] sizeof (int) == sizeof (void*)?

查看:34
本文介绍了sizeof (int) == sizeof (void*)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在与指针大小相同的整数类型?在所有微架构上都得到保证?

Is there an integer type with the same size as pointer? Guaranteed on all microarchitectures?

推荐答案

根据 this Wikipedia page,在 C99 中,您的 stdint.h 标头可能声明 intptr_t 和 uintptr_t,但这当然需要

According to this Wikipedia page, in C99 your stdint.h header might declare intptr_t and uintptr_t, but then that of course requires

  • C99
  • 选择实现标准的这个可选部分的编译器实现者

所以总的来说,我认为这个很难.

So in general I think this one is tough.

这篇关于sizeof (int) == sizeof (void*)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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