C#的类型列表

Posted Demo233

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了C#的类型列表相关的知识,希望对你有一定的参考价值。

以下是 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 仅接受真、假而非任意整数。

 

以上是关于C#的类型列表的主要内容,如果未能解决你的问题,请参考以下文章