C# 数据类型

C# 数据类型

  • [一、整数类型(Integral Types)](#一、整数类型(Integral Types))
  • [二、浮点数类型(Floating-Point Types)](#二、浮点数类型(Floating-Point Types))
  • [三、字符类型(Character Type)](#三、字符类型(Character Type))
  • [四、布尔类型(Boolean Type)](#四、布尔类型(Boolean Type))
  • [五、字符串类型(String Type)](#五、字符串类型(String Type))
  • [六、对象类型(Object Type)](#六、对象类型(Object Type))
  • [七、枚举类型(Enumeration Type)](#七、枚举类型(Enumeration Type))
  • [八、结构类型(Struct Type)](#八、结构类型(Struct Type))
  • [九、数组类型(Array Type)](#九、数组类型(Array Type))
  • [十、Nullable 类型(Nullable Types)](#十、Nullable 类型(Nullable Types))
  • [十一、指针类型(Pointer Types)](#十一、指针类型(Pointer Types))

一、整数类型(Integral Types)

1.sbyte

8 位有符号整数。

2.byte

8 位无符号整数

3.short

16 位有符号整数

4.ushort

16 位无符号整数

5.int

32 位有符号整数

6.uint

32 位无符号整数

7.long

64 位有符号整数

8.ulong

64 位无符号整数

二、浮点数类型(Floating-Point Types)

1.float

32 位单精度浮点数

2.double

64 位双精度浮点数

3.decimal

128 位高精度十进制浮点数

三、字符类型(Character Type)

1.char

16 位 Unicode 字符

四、布尔类型(Boolean Type)

1.bool

表示真值(true 或 false)

五、字符串类型(String Type)

1.string

表示文本字符串

六、对象类型(Object Type)

1.object

所有类型的基类

七、枚举类型(Enumeration Type)

1.enum

一组具名的常数值

八、结构类型(Struct Type)

1.struct

用户定义的值类型

九、数组类型(Array Type)

1.

数组类型用于存储相同类型的元素的集合

十、Nullable 类型(Nullable Types)

1.Nullable

允许值类型存储 null 值

十一、指针类型(Pointer Types)

1.unsafe

unsafe 上下文中,可以使用指针访问内存地址

相关推荐
★YUI★10 小时前
学习游戏制作记录(玩家掉落系统,删除物品功能和独特物品)8.17
java·学习·游戏·unity·c#
谷宇.10 小时前
【Unity3D实例-功能-拔枪】角色拔枪(二)分割上身和下身
游戏·unity·c#·游戏程序·unity3d·游戏开发·游戏编程
LZQqqqqo11 小时前
C# 中 ArrayList动态数组、List<T>列表与 Dictionary<T Key, T Value>字典的深度对比
windows·c#·list
Dm_dotnet13 小时前
Stylet启动机制详解:从Bootstrap到View显示
c#
三千道应用题15 小时前
WPF&C#超市管理系统(6)订单详情、顾客注册、商品销售排行查询和库存提示、LiveChat报表
开发语言·c#·wpf
唐青枫19 小时前
别滥用 Task.Run:C# 异步并发实操指南
c#·.net
我好喜欢你~1 天前
C#---StopWatch类
开发语言·c#
一阵没来由的风1 天前
拒绝造轮子(C#篇)ZLG CAN卡驱动封装应用
c#·can·封装·zlg·基础封装·轮子
一枚小小程序员哈2 天前
基于微信小程序的家教服务平台的设计与实现/基于asp.net/c#的家教服务平台/基于asp.net/c#的家教管理系统
后端·c#·asp.net
Eternity_GQM2 天前
【Word VBA Zotero 引用宏错误分析与改正指南】【解决[21–23]参考文献格式插入超链接问题】
开发语言·c#·word