zoukankan      html  css  js  c++  java
  • C#类型 参考表(MSDN)

    值类型表

    值类型 类别

    bool

    布尔型

    byte

    无符号、数值、整数

    char

    无符号、数值、整数

    decimal

    数值、十进制

    double

    数值、浮点

    enum

    枚举

    float

    数值、浮点

    int

    有符号、数值、整数

    long

    有符号、数值、整数

    sbyte

    有符号、数值、整数

    short

    有符号、数值、整数

    struct

    用户定义的结构

    uint

    无符号、数值、整数

    ulong

    无符号、数值、整数

    ushort

    无符号、数值、整数



    整型表

    类型 范围 大小

    sbyte

    -128 到 127

    有符号 8 位整数

    byte

    0 到 255

    无符号 8 位整数

    char

    U+0000 到 U+ffff

    16 位 Unicode 字符

    short

    -32,768 到 32,767

    有符号 16 位整数

    ushort

    0 到 65,535

    无符号 16 位整数

    int

    -2,147,483,648 到 2,147,483,647

    有符号 32 位整数

    uint

    0 到 4,294,967,295

    无符号 32 位整数

    long

    -9,223,372,036,854,775,808 到 9,223,372,036,854,775,807

    有符号 64 位整数

    ulong

    0 到 18,446,744,073,709,551,615

    无符号 64 位整数



    浮点型表

    类型 大致范围 精度

    float

    ±1.5e−45 到 ±3.4e38

    7 位

    double

    ±5.0e−324 到 ±1.7e308

    15 到 16 位



    内置类型表

    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


        备注
           除了 objectstring 外,表中的所有类型均称为简单类型。

    默认值表

    值类型 默认值

    bool

    false

    byte

    0

    char

    '"0'

    decimal

    0.0M

    double

    0.0D

    enum

    表达式 (E)0 产生的值,其中 E 为 enum 标识符。

    float

    0.0F

    int

    0

    long

    0L

    sbyte

    0

    short

    0

    struct

    将所有的值类型字段设置为默认值并将所有的引用类型字段设置为 null 时产生的值。

    uint

    0

    ulong

    0

    ushort

    0



    隐式数值转换表


    sbyte

    shortintlongfloatdoubledecimal

    byte

    shortushortintuintlongulongfloatdoubledecimal

    short

    intlongfloatdoubledecimal

    ushort

    intuintlongulongfloatdoubledecimal

    int

    longfloatdoubledecimal

    uint

    longulongfloatdoubledecimal

    long

    floatdoubledecimal

    char

    ushortint uint longulong floatdoubledecimal

    float

    double

    ulong

    float doubledecimal


  • 相关阅读:
    The jQuery UI CSS Framework(中文说明)
    锁定表头和固定列(Fixed table head and columns)
    html5学习二(canvas)
    浅析深究什么是SOA
    页面加载完毕后执行js函数的方法
    Spring AOP详解(转)
    db2move详解
    DB2 命令总汇
    Ubuntu下Apache的配置
    maven打包的一些问题
  • 原文地址:https://www.cnblogs.com/scottckt/p/1028745.html
Copyright © 2011-2022 走看看