首页 > 学院 > 开发设计 > 正文

C#数据类型与.NET CTS的映射关系

2019-11-17 02:15:02
字体:
来源:转载
供稿:网友

C#数据类型与.NET CTS的映射关系

  C#语言中常见值类型,如:int、float、double、bool等都是.NET CTS(通用类型系统)的别名,附表如下:

C# 类型

.NET Framework 类型

bool

System.Boolean

byte

System.Byte

sbyte

System.SByte

char

System.Char

decimal

System.Decimal

double

System.Double

float

System.Single

int

System.Int32

uint

System.UInt32

long

System.Int64

ulong

System.UInt64

object

System.Object

short

System.Int16

ushort

System.UInt16

string

System.String

  那么我们申明变量并初始化就有两种选择啦

  例如:

  int s = 15;

  Int32 w = s;

  其它类型和int类型相同。


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表