为什么.NET使用int,而不是UINT在某些课? [英] Why does .NET use int instead of uint in certain classes?

查看:133
本文介绍了为什么.NET使用int,而不是UINT在某些课?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我总是会遇到使用code INT 对于像 .Count之间等,即使在框架类,而不是 UINT

I always come across code that uses int for things like .Count, etc, even in the framework classes, instead of uint.

有什么原因?

推荐答案

UInt32的不是的符合CLS 所以它可能不提供针对公共语言规范所有的语言。 的Int32 是CLS兼容的,因此是保证在所有语言的存在。

UInt32 is not CLS compliant so it might not be available in all languages that target the Common Language Specification. Int32 is CLS compliant and therefore is guaranteed to exist in all languages.

这篇关于为什么.NET使用int,而不是UINT在某些课?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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