您的位置:首页 > 其它

常用程序语言的数据类型比较

2009-02-22 21:28 295 查看
Win32 Types
CLR Type
char, INT8, SBYTE, CHAR
System.SByte
short, short int, INT16, SHORT
System.Int16
int, long, long int, INT32, LONG32, BOOL , INT
System.Int32
__int64, INT64, LONGLONG
System.Int64
unsigned char, UINT8, UCHAR , BYTE
System.Byte
unsigned short, UINT16, USHORT, WORD, ATOM, WCHAR , __wchar_t
System.UInt16
unsigned, unsigned int, UINT32, ULONG32, DWORD32, ULONG, DWORD, UINT
System.UInt32
unsigned __int64, UINT64, DWORDLONG, ULONGLONG
System.UInt64
float, FLOAT
System.Single
double, long double, DOUBLE
System.Double
下表列出了 .NET Framework 支持的一些值类型,简要描述了每个类型,并指示 Visual Basic、C# 和 C++ 托管扩展中的相应类型。表中还包括 Object 和 String 类的项,这些项在许多语言中都有相应的关键字。

类别
类名
说明
Visual Basic 数据类型
C# 数据类型
C++ 托管扩展数据类型
JScript 数据类型
整数
Byte
8 位的无符号整数。
Byte
byte
char
Byte
SByte
8 位的有符号整数。
不符合 CLS。
SByte
无内置类型。
sbyte
signed char
SByte
Int16
16 位的有符号整数。
Short
short
short
short
Int32
32 位的有符号整数。
Integer
int
int
- 或 -
long
int
Int64
64 位的有符号整数。
Long
long
__int64
long
类别
类名
说明
Visual Basic 数据类型
C# 数据类型
C++ 托管扩展数据类型
JScript 数据类型
UInt16
16 位的无符号整数。
不符合 CLS。
UInt16
无内置类型。
ushort
unsigned short
UInt16
UInt32
32 位的无符号整数。
不符合 CLS。
UInt32
无内置类型。
uint
unsigned int
- 或 -
unsigned long
UInt32
UInt64
64 位的无符号整数。
不符合 CLS。
UInt64
无内置类型。
ulong
unsigned __int64
UInt64
类别
类名
说明
Visual Basic 数据类型
C# 数据类型
C++ 托管扩展数据类型
JScript 数据类型
浮点
Single
单精度(32 位)浮点数字。
Single
float
float
float
Double
双精度(64 位)浮点数字。
Double
double
double
double
逻辑
Boolean
布尔值(真或假)。
Boolean
bool
bool
bool
其他
Char
Unicode(16 位)字符。
Char
char
wchar_t
char
Decimal
96 位十进制值。
Decimal
decimal
Decimal
Decimal
IntPtr
大小取决于基础平台(32 位平台上为 32 位值,64 位平台上为 64 位值)的有符号整数。
IntPtr
无内置类型。
IntPtr
无内置类型。
IntPtr
无内置类型。
IntPtr
UIntPtr
大小取决于基础平台的无符号整数(32 位平台上为 32 位值,64 位平台上为 64 位值)。
不符合 CLS。
UIntPtr
无内置类型。
UIntPtr
无内置类型。
UIntPtr
无内置类型。
UIntPtr
类对象
Object
对象层次结构的根。
Object
object
Object*
Object
String
Unicode 字符的不变的定长串。
String
string
String*
String
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐