卓越飞翔博客卓越飞翔博客

卓越飞翔 - 您值得收藏的技术分享站
技术文章44898本站已运行31029

c#中的基本数据类型有哪些

c#中提供的基本数据类型包括:整型(byte、sbyte、short、ushort、int、uint、long、ulong),浮点型(float、double),其他类型(char、bool、decimal、string)。

c#中的基本数据类型有哪些

C# 中的基本数据类型

C# 提供了一系列基本数据类型,用于表示不同类型的数据。这些基本数据类型包括:

整型

  • byte: 8 位无符号整数(0-255)
  • sbyte: 8 位有符号整数(-128-127)
  • short: 16 位有符号整数(-32,768-32,767)
  • ushort: 16 位无符号整数(0-65,535)
  • int: 32 位有符号整数(-2,147,483,648-2,147,483,647)
  • uint: 32 位无符号整数(0-4,294,967,295)
  • long: 64 位有符号整数(-9,223,372,036,854,775,808-9,223,372,036,854,775,807)
  • ulong: 64 位无符号整数(0-18,446,744,073,709,551,615)

浮点型

  • float: 32 位浮点数
  • double: 64 位浮点数

其他

  • char: 16 位 Unicode 字符
  • bool: 布尔值(true/false)
  • decimal: 128 位十进制数据类型,用于高精度计算
  • string: Unicode 字符串
卓越飞翔博客
上一篇: c#语言的数据类型有哪些?
下一篇: 返回列表
留言与评论(共有 0 条评论)
   
验证码:
隐藏边栏