c#数据类型和基本的类型转换

基本数据类型

1整型

byle                 byte

short                Int16

int                    Int32

long                 Int64

2浮点型

float                 Single

Double     Double

decimal       Decimal

3字符型

char              char

4布尔型

bool               Boolean

字符串型

string

日期类型

DateTime

*类型转换

1自动转换                例子:int a;double b=12.3;a=(int)b

2强制转换     用convert:int a;float c; double b=12.3

          a=convert.ToInt(b)    ;c=convert.ToSingle(b);

          用parse:int a;double b=12.3;

          a=int.parse(b);           

posted @ 2017-10-31 16:19  sistrong  阅读(350)  评论(0编辑  收藏  举报