c# - x64 上的 sizeof(int)?

标签 c# 64-bit clr sizeof

当我在我的 C#.NET 项目中执行 sizeof(int) 时,我得到一个返回值 4。我将项目类型设置为 x64,那么为什么它说的是 4 而不是 8?这是因为我正在运行托管代码吗?

最佳答案

关键字 intSystem.Int32 的别名,它仍然需要 4 个字节,即使在 64 位机器上也是如此。

关于c# - x64 上的 sizeof(int)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/651956/

相关文章:

c# - XML 反序列化单元测试

c# - C# Unity3D 中的未分配引用异常

visual-c++ - 如何将汇编标记放入 C++ 代码 (x64)

c++ - 从命令行构建 x64 C++ 项目说 : This operation should only take place on the UI thread

c# - 在 C 库调用中保留对 .NET 对象的 C++/CLI 句柄

c# - BizTalk 与 BTARN : Cannot locate document specification because multiple schemas matched the message type "string"

c# - 使用 OleDb 写入 Excel

multithreading - 在 amd64 上拆分堆栈是不必要的

visual-studio-2012 - 奇怪的名字混淆

.NET Web 应用程序 w3wp.exe 问题