c# int uint32

C#Int32和C#UInt32 (C# Int32 and C# UInt32)

In C#, Int32 known as a signed integer of 4 bytes which can store both types of values including negative and positive between the ranges of -2147483648 to +2147483647.

在C#中, Int32被称为4字节的有符号整数,它可以存储-2147483648至+2147483647范围之间的两种类型的值,包括负数和正数。

UInt32 known as an unsigned integer of 4 bytes which can store only positive values between the ranges of 0 to 4294967295.

UInt32,它是4个字节的无符号整数 ,只能存储0到4294967295范围之间的正值。

'Int32'和'UInt32'之间的区别 (Differences between 'Int32' and 'UInt32')

Int32 UInt32
Int32 stands for signed integer. UInt32 stands for unsigned integer.
It's capacity to store the value is -2147483648 to +2147483647. It's capacity to store the value is 0 to 4294967295.
It can store negative and positive integers. It can store only positive integers.
It occupies 4-bytes space in the memory. It also occupies 4-bytes space in the memory.
Declaration syntax:
Int32 variable;
Declaration syntax:
UInt32 variable;
32位 UInt32
Int32代表有符号整数。 UInt32代表无符号整数。
它存储值的能力是-2147483648至+2147483647。 该值的存储容量为0到4294967295。
它可以存储负整数和正整数。 它只能存储正整数。
它在内存中占用4个字节的空间。 它还在内存中占用4字节的空间。
声明语法:
Int32变量;
声明语法:
UInt32变量;

Example:

例:

In this example, to explain the differences between Int32 and UInt32 in C#, we are printing their minimum and maximum values, we are also declaring two arrays – arr1 is a signed integer type and arr2 is an unsigned integer type. Initializing the arrays with corresponding negative and positive values based on their capacity.

在此示例中,为了解释C#中Int32和UInt32之间区别 ,我们将打印它们的最小值和最大值,同时还声明了两个数组– arr1是有符号整数类型,而arr2是无符号整数类型。 根据其容量用相应的负值和正值初始化数组。

using System;
using System.Text;
namespace Test
{class Program
{static void Main(string[] args)
{//Int32 value range
Console.WriteLine("Int32 value capacity...");
Console.WriteLine("Min: {0}, Max: {1}\n", Int32.MinValue, Int32.MaxValue);
//UInt32 value range
Console.WriteLine("UInt32 value capacity...");
Console.WriteLine("Min: {0}, Max: {1}\n", UInt32.MinValue, UInt32.MaxValue);
//Int32 array
Int32[] arr1 = { -2147483648, 0, 12320009, 2147480000, 2147483647 };
Console.WriteLine("UInt32 array elements...");
foreach (Int32 num in arr1)
{Console.WriteLine(num);
}
Console.WriteLine();
//UInt32 array
UInt32[] arr2 = { 0, 100, 23000, 4294960000, 4294967295 };
Console.WriteLine("UInt32 array elements...");
foreach (UInt32 num in arr2)
{Console.WriteLine(num);
}
//hit ENTER to exit
Console.ReadLine();
}
}
}

Output

输出量

Int32 value capacity...
Min: -2147483648, Max: 2147483647
UInt32 value capacity...
Min: 0, Max: 4294967295
UInt32 array elements...
-2147483648
0
12320009
2147480000
2147483647
UInt32 array elements...
0
100
23000
4294960000
4294967295

翻译自: https://www.includehelp.com/dot-net/Int32-and-UInt32-in-c-sharp.aspx

c# int uint32

c# int uint32_C#中Int32和UInt32之间的区别相关推荐

  1. sql server序列_SQL Server中身份和序列之间的区别

    sql server序列 In SQL Server, both the SEQUENCE object and IDENTITY property are used to generate a se ...

  2. python观察日志(part20)--列表中加号,extend,append之间的区别

    学习笔记,仅供参考,有错必纠 列表中"+"加号,extend,append之间的区别 extend extend函数用于在列表末尾一次性追加另一个序列中的多个值. append a ...

  3. python __import__和import区别_Python中import 与__import__() 之间的区别比较

    本篇文章给大家带来的内容是关于Python中import 与__import__() 之间的区别比较,有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助. 首先来说一下两者的区别: impo ...

  4. Oracle中用户和架构之间的区别?

    本文翻译自:Difference between a user and a schema in Oracle? Oracle中的用户和架构有什么区别? #1楼 参考:https://stackoom. ...

  5. C#中Int64和UInt64之间的区别

    Int64:此 Struct用于表示64位带符号整数.所述的Int64 可以两种类型的值,包括所述范围之间的负的和正的存储-9,223,372,036,854,775,808至9,223,372,03 ...

  6. -ms-flexbox_Flexbox中width和flex-basis之间的区别

    -ms-flexbox by Kyle Gallagher 凯尔·加拉格尔(Kyle Gallagher) Flexbox中width和flex-basis之间的区别 (The difference ...

  7. Jquery中.val()与.value之间的区别

    三年多没敲过代码了,今年打算捡起来,是需要多么大的勇气.但是为了实现自我价值,履行自我的承诺,这就是责任.没有什么难不难,晚不晚之说,是我经常对别人说的那样,再晚不过心晚,,一切努力了,实现了每一天的 ...

  8. Java中Comparator和Comparable之间的区别

    常见的面试问题之一是"比较器和可比较器之间有什么区别". 或"您将如何通过其ID或名称对员工对象集合进行排序".为此,我们可以使用两个接口,即Comparato ...

  9. angularjs 中 Factory,Service,Provider 之间的区别

    本片文章是使用了 angularjs 中使用 service 在controller 之间 share 对象和数据 的code(http://jsfiddle.net/kn46u0uj/1/) 来进行 ...

最新文章

  1. Andraoid 状态栏透明的方法
  2. ArcGIS Engine 项目10.1升级10.2
  3. 【树莓派】可能是最简单粗暴的树莓派搭建个人网站教程
  4. Hibernate一对一关联------主键关联(亲测成功)
  5. 【牛客 - 301哈尔滨理工大学软件与微电子学院第八届程序设计竞赛同步赛(高年级)】小乐乐的组合数+(取模,数学,思维)
  6. shell内部命令和外部命令
  7. pmp知识点详解-项目大牛整理_PMP项目管理第六章:项目进度管理(5)核心知识点...
  8. 虚拟机安装菜鸟教程(2)——CentOS8系统安装 网络 时间配置
  9. vue.js 源代码学习笔记 ----- decoder
  10. 温故而知新_C语言_define_宏
  11. tensorflow之add_n
  12. php防止sql注入的方法
  13. PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed
  14. CSDN写博客修改图片大小、图片居中、去掉图片水印等方法
  15. 服务注册中心:Eureka
  16. Qt5 源代码自动跳转
  17. 平面内有N个点,如何快速求出距离最近的点对?
  18. jQuery中添加元素删除元素的方法
  19. A2021-A2022年度项目总结(二)
  20. nginx服务器的文档根目录,nginx更改根目录

热门文章

  1. 精读3:关于电商数据分析,你知道多少
  2. 关于思科无线你最好知道的十个知识点
  3. spring 整合mybatis时候 MapperScannerConfigure的配置问题
  4. 第 4 章 复合类型
  5. 2020年TI杯大学生电子设计大赛 无线运动传感器节点 作品开源( PCB、设备/服务器工程、文档、测试视频、设计报告)
  6. 需要什么PCB封装,照着弄就好了
  7. PHPMailer邮箱发送配置匿名邮箱
  8. 使用 Satis 搭建私有仓库
  9. 保存网页中的css和js文件,网站保存,复制网站不可复制的文字,网站抠图
  10. 人工智能辅助药物发现(1)肿瘤靶点识别