在 C# 中,ushort.MaxValue 表示无符号短整型所能表示的最大值,为 65535。将 ushort.MaxValue 强制转换为 int 类型后,仍然得到 65535。这是因为 int 是有符号整数,其取值范围为 -2,147,483,648 到 2,147,483,647,而 65535 在这个范围内。

因此, (int)ushort.MaxValue 等于 65535。

C# 中 (int)ushort.MaxValue 等于多少?

原文地址: https://www.cveoy.top/t/topic/jlbr 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录