INT32与Int64的与智力在C# [英] Int32 vs. Int64 vs. Int in C#

查看:259
本文介绍了INT32与Int64的与智力在C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
  假设32位整数

所以,我读的地方,INT等于INT32在C#。 这是真的以及64位的机器吗? 我应该使用INT32只是为了确保没有人在微软决定改变int的长度?

So I read somewhere that int equals int32 in c#. Is it true also on 64-bit machines? Should I use int32 just to make sure no one at microsoft decides to change the size of int?

推荐答案

INT 的别名的Int32

的别名的Int64

它们的大小不会改变,在所有的,只需使用任何一个你需要使用。

Their sizes will not change, at all, just use whichever one you need to use.

在code中的使用它们绝不涉及32位和64位机

The use of them in your code is in no way related to 32bit and 64bit machines

编辑: 在谈到有关线程安全的意见。这里是一个很好的问题,而细节的任何问题,你需要知道的答案。 <一href="http://stackoverflow.com/questions/596065/under-c-is-int64-use-on-a-32-bit-processor-dangerous">http://stackoverflow.com/questions/596065/under-c-is-int64-use-on-a-32-bit-processor-dangerous

In reference to the comments about Thread Safety. Here is a good question and answers that detail any issues you need to be aware of. http://stackoverflow.com/questions/596065/under-c-is-int64-use-on-a-32-bit-processor-dangerous

这篇关于INT32与Int64的与智力在C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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