以下是 C# 内建类型的列表:

类型        字节        描述
byte        1          unsigned byte 
sbyte      1          signed byte 
short      2          signed short 
ushort      2          unsigned short 
int        4          signed integer 
uint        4          unsigned integer 
long        8          signed long 
ulong      8          unsigned long 
float      4          floating point number 
double      8          double precision number 
decimal    8          fixed precision number 
string      -          Unicode string 
char        -          Unicode char 
bool        true, false boolean 

注意:C# 的类型范围和 C++ 不同。例如:long 在 C++ 中是 4 字节而在 C# 中是 8 字节。
boolstring 类型均和 C++ 不同。bool 仅接受真、假而非任意整数。

 

相关文章:

  • 2022-01-09
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
  • 2022-12-23
  • 2021-09-18
猜你喜欢
  • 2021-06-03
  • 2022-12-23
  • 2022-01-19
  • 2022-12-23
相关资源
相似解决方案