int 是 64 位 C# 中的 64 位整数吗? [英] Is an int a 64-bit integer in 64-bit C#?
本文介绍了int 是 64 位 C# 中的 64 位整数吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的 C# 源代码中,我可能将整数声明为:
In my C# source code I may have declared integers as:
int i = 5;
或
Int32 i = 5;
在当前流行的 32 位世界中,它们是等效的.但是,随着我们进入 64 位世界,我说以下内容会变得相同是否正确?
In the currently prevalent 32-bit world they are equivalent. However, as we move into a 64-bit world, am I correct in saying that the following will become the same?
int i = 5;
Int64 i = 5;
推荐答案
没有.C# 规范严格定义 int
是 System.Int32
的别名,正好是 32 位.改变这将是一个重大突破性变化.
No. The C# specification rigidly defines that int
is an alias for System.Int32
with exactly 32 bits. Changing this would be a major breaking change.
这篇关于int 是 64 位 C# 中的 64 位整数吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文