的sizeof(int)的x64上? [英] sizeof(int) on x64?

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

问题描述

当我这样做的sizeof(int)的在我的C#.NET项目中,我得到4.我设置项目类型到x64返回值,那么为什么没有说4而不是8?这是因为我正在设法code?

When I do sizeof(int) in my C#.NET project I get a return value of 4. I set the project type to x64, so why does it say 4 instead of 8? Is this because I'm running managed code?

推荐答案

各种64位数据模型; Microsoft使用LP64为.NET:双方的的S和指针是64位(虽然传统的C风格的指针不存在.NET)。与ILP64对比这其中 INT 是也64位。

There are various 64-bit data models; Microsoft uses LP64 for .NET: both longs and pointers are 64-bits (although traditional C-style pointers don't exist .NET). Contrast this with ILP64 where ints are also 64-bits.

因此​​,在所有平台上, INT 是32位和是64位;你可以看到这个名字的基础类型的 System.Int32的 System.Int64 的。

Thus, on all platforms, int is 32-bits and long is 64-bits; you can see this in the names of the underlying types System.Int32 and System.Int64.

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

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