Visual Basic、C# 和 C++ 的数据类型比较(转)
生活随笔
收集整理的這篇文章主要介紹了
Visual Basic、C# 和 C++ 的数据类型比较(转)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
| 類別 | 類名 | 說明 | Visual Basic 數據類型 | C# 數據類型 | C++ 托管擴展數據類型 | JScript 數據類型 |
| 整數 | Byte | 8 位的無符號整數。 | Byte | byte | char | Byte |
| DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | SByte | 8 位的有符號整數。 不符合 CLS。DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | SByte 無內置類型。DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | sbyte | signed char | SByte |
| DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | Int16 | 16 位的有符號整數。 | Short | short | short | short |
| DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | Int32 | 32 位的有符號整數。 | Integer | int | int - 或 -DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se longDZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | int |
| DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | Int64 | 64 位的有符號整數。 | Long | long | __int64 | long |
| DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | UInt16 | 16 位的無符號整數。 不符合 CLS。DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | UInt16 無內置類型。DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | ushort | unsigned short | UInt16 |
| DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | UInt32 | 32 位的無符號整數。 不符合 CLS。DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | UInt32 無內置類型。DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | uint | unsigned int - 或 -DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se unsigned longDZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | UInt32 |
| DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | UInt64 | 64 位的無符號整數。 不符合 CLS。DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | UInt64 無內置類型。DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | ulong | unsigned __int64 | UInt64 |
| 浮點 | Single | 單精度(32 位)浮點數字。 | Single | float | float | float |
| DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | Double | 雙精度(64 位)浮點數字。 | Double | double | double | double |
| 邏輯 | Boolean | 布爾值(真或假)。 | Boolean | bool | bool | bool |
| 其他 | Char | Unicode(16 位)字符。 | Char | char | wchar_t | char |
| DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | Decimal | 96 位十進制值。 | Decimal | decimal | Decimal | Decimal |
| DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | IntPtr | 大小取決于基礎平臺(32 位平臺上為 32 位值,64 位平臺上為 64 位值)的有符號整數。 | IntPtr 無內置類型。DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | IntPtr 無內置類型。DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | IntPtr 無內置類型。DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | IntPtr |
| DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | UIntPtr | 大小取決于基礎平臺的無符號整數(32 位平臺上為 32 位值,64 位平臺上為 64 位值)。 不符合 CLS。DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | UIntPtr 無內置類型。DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | UIntPtr 無內置類型。DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | UIntPtr 無內置類型。DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | UIntPtr |
| 類對象 | Object | 對象層次結構的根。 | Object | object | Object* | Object |
| DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se | String | Unicode 字符的不變的定長串。 | String | string | String* | String |
DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se
平臺調用數據類型 DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se
DZX7¢?&dot÷ [url]www.cnntec.com[/url]¨…gúT??se
| Wtypes.h 中的非托管類型 | 非托管 C 語言類型 | 托管類名 | 說明 |
| HANDLE | void* | System.IntPtr | 32 位 |
| BYTE | unsigned char | System.Byte | 8 位 |
| SHORT | short | System.Int16 | 16 位 |
| WORD | unsigned short | System.UInt16 | 16 位 |
| INT | int | System.Int32 | 32 位 |
| UINT | unsigned int | System.UInt32 | 32 位 |
| LONG | long | System.Int32 | 32 位 |
| BOOL | long | System.Int32 | 32 位 |
| DWORD | unsigned long | System.UInt32 | 32 位 |
| ULONG | unsigned long | System.UInt32 | 32 位 |
| CHAR | char | System.Char | 用 ANSI 修飾。 |
| LPSTR | char* | System.String 或 System.StringBuilder | 用 ANSI 修飾。 |
| LPCSTR | Const char* | System.String 或 System.StringBuilder | 用 ANSI 修飾。 |
| LPWSTR | wchar_t* | System.String 或 System.StringBuilder | 用 Unicode 修飾。 |
| LPCWSTR | Const wchar_t* | System.String 或 System.StringBuilder | 用 Unicode 修飾。 |
| FLOAT | Float | System.Single | 32 位 |
| DOUBLE | Double | System.Double | 64 位 |
轉載于:https://blog.51cto.com/dotnet/63448
總結
以上是生活随笔為你收集整理的Visual Basic、C# 和 C++ 的数据类型比较(转)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 希望不要T我~~哈哈...
- 下一篇: C# aspx页面动态加载ascx用户控