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 上下文中,可以使用指针访问内存地址

相关推荐
Chris _data17 分钟前
并发单词频率统计器 - 从零到完整实现(C# 实战)
开发语言·c#
iCxhust10 小时前
C# 命令行指令 查看二进制文件
开发语言·单片机·嵌入式硬件·c#·proteus·微机原理·8088单板机
雪豹阿伟12 小时前
15.C# —— 多接口,泛型方法,泛型效率、泛型类和泛型接口、泛型约束
c#·上位机
影寂ldy12 小时前
C# const 常量 / readonly 只读 / static readonly
java·开发语言·c#
iCxhust13 小时前
c#多串口重量采集上位机程序
开发语言·汇编·c#·微机原理·8088单板机
雪豹阿伟13 小时前
14.C# —— 虚方法,new/override,密封类,索引器,接口
c#·上位机
糖果店的幽灵14 小时前
LangChain 1.3 完全教程:从入门到精通-Part 11: Tools(工具系统)
开发语言·langchain·c#
专注VB编程开发20年18 小时前
python翻译网页HTML的难题
python·c#·html
z落落18 小时前
C# 抽象类(abstract)
java·开发语言·c#