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

 

posted @ 2016-12-03 10:23  hoey94  阅读(1663)  评论(0编辑  收藏  举报