C# 值类型

  • 结构体:struct(直接派生于System.ValueType);
    • 数值类型:
      • 整型:sbyte(System.SByte的别名),short(System.Int16),int(System.Int32),long(System.Int64),byte(System.Byte),ushort(System.UInt16),uint(System.UInt32),ulong(System.UInt64),char(System.Char);
      • 浮点型:float(System.Single),double(System.Double);
      • 用于财务计算的高精度decimal型:decimal(System.Decimal)。
    • bool型:bool(System.Boolean的别名);
    • 用户定义的结构体(派生于System.ValueType)。
  • 枚举:enum(派生于System.Enum);
  • 可空类型(派生于System.Nullable<T>泛型结构体,T?实际上是System.Nullable<T>的别名)。

posted @ 2010-03-25 01:00  Freedom  阅读(200)  评论(0编辑  收藏  举报