C#2008整数变量类型

时间:2020-02-23 14:29:50  来源:igfitidea点击:

每个变量在C#中具有固定类型,并且整数(int)变量类型仅限于整数。
C# 有其他几个整数变量类型,如图所示:

类型大小(字节)范围示例
SBYTE1-128到127SBYTE SB = -12;
byte10到255byte b = 12;
short2-32,768至32,767short sn = -123;
Ushort20到65,535USHORT USN = 123;
int4-2,147,483,648至2,147,483,647int n = 123;
uint40至4,294,967,295UINT UN = 123U;
long8-9,223,372,036,854,775,808至9,223,372,036,854,775,807long l = 123l;
ulong80至18,446,744,073,709,551,615long ul = 123ul;