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

相关推荐
唐青枫8 小时前
对象到底住在哪里?C#.NET 托管堆从分配、GC 到内存排查
c#·.net
fogota9 小时前
Emoji与Segoe MDL2 Assets的比较
c#·wpf
灸木10 小时前
C# 多线程与异步
c#
鱼听禅14 小时前
C# 学习笔记-使用 类型化客户端搭建HTTP客户端服务
学习·http·c#·工厂方法模式
geovindu16 小时前
CSharp:Condition Variable Pattern
后端·设计模式·c#·.net·.netcore·条件变量模式·同步型模式
淡海水17 小时前
11-03-Unity-List-T-和Dictionary-TKey-TValue-的性能调优实战
算法·unity·c#·list·dictionary
fogota17 小时前
C# 如何调用系统图标
c#·.net
△曉風殘月〆18 小时前
.NET是什么?为什么要选择.NET?
c#·.net·.net core·clr
fogota18 小时前
C# WPF 按钮加载字体图标 / 动物头像
c#·.net·wpf
fogota18 小时前
C# WPF 按钮加载系统图标 / 动物头像
c#·.net·wpf