Unity学习路线之C#基础----基本变量

C#基本变量类型:

object              System.Object        所有其它类型的基类型

string               System.String        Unicode字符序列

decimal              System.Decimal       有28位小数的高度精度浮点数

bool                 System.Boolean       true或false

char                 System.Char          16位Unicode字符

byte                 System.Byte          8位无符号整型

sbyte                System.Sbyte         8位有符号整型

short                System.Int16         16位有符号整型

int                  System.Int32         32位有符号整型

long                 System.Int64         64位有符号整型

ushort               System.Uint16        16位无符号整型

uint                 System.Uint32        32位无符号整型

ulong                System.Uint64        64位无符号整型

float                 System.Single        单精度浮点类型

double               System.Double        双精度浮点类型


表示数字的有:byte,sbyte,short,ushort,int,uint,long,ulong,float,double,decimal.其中float,double,decimal表示小数

string 表示字符串,char表示字符,例:string="hello";     char='h',  string用双引号,char用单引号

bool类型只有两个值true或者false

最常用的有:int,float,double,bool,string



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值