是一个int 64位整数的64位C#? [英] Is an int a 64-bit integer in 64-bit C#?

查看:285
本文介绍了是一个int 64位整数的64位C#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的C#源$ C ​​$ C我可能已经宣布的整数为:

  INT I = 5;
 

 的Int32 i = 5;
 

在当前prevalent 32位的世界里,他们是等价的。然而,当我们进入一个64位的世界里,我是正确的说,下面会成为一样的吗?

  INT I = 5;
我的Int64 = 5;
 

解决方案

没有。 C#的规范严格定义了 INT System.Int32的的别名恰好有32位。改变这将是一个的主要的重大更改。

In my C# source code I may have declared integers as:

int i = 5;

or

Int32 i = 5;

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;

解决方案

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位整数的64位C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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