c++与c#数据类型对照表
https://learn.microsoft.com/zh-cn/windows/win32/winrt/base-data-types?redirectedfrom=MSDN
下表列出了Windows 运行时支持的基数据类型,并指示 C#、Visual Basic 和 C++ 中的相应类型。
| 数据类型 | JavaScript | C# | VB | C++ |
|---|---|---|---|---|
| 布尔值 | 布尔值 | bool | 布尔值 | bool |
| Byte | 数字 | byte | Byte | unsigned char |
| Char | 字符串 | char | Char | unsigned char |
| Char16 | 字符串 | char | Char | wchar_t |
| DateTime | Date | DateTimeOffset | DateTimeOffset | DateTime |
| 双精度 | 数字 | double | 双精度 | double |
| Guid | 字符串 | Guid | Guid | Guid |
| Int16 | 数字 | short | Short | short |
| Int32 | 数字 | int | Integer | int |
| Int64 | 数字 | long | Long | __int64 |
| Object | Object | object | Object | Object^ |
| Point | Point | Point | Point | Point |
| Rect | Rect | Rect | Rect | Rect |
| 单精度 | 数字 | float | 单精度 | float |
| 大小 | 大小 | 大小 | 大小 | 大小 |
| 字符串 | 字符串 | string | 字符串 | String^ |
| TimeSpan | 数字 | TimeSpan | TimeSpan | TimeSpan |
| UInt8 | 数字 | byte | Byte | unsigned char |
| UInt16 | 数字 | ushort | UShort | unsigned short |
| UInt32 | 数字 | uint | UInteger | unsigned int |
| UInt64 | 数字 | ulong | ULong | unsigned __int64 |
| Uri | Uri | Uri | Uri | Uri^ |
| 无效 | Undefined | void | 无效 | void |
下表指示对应于Windows 运行时数据类型的 .NET 类型。
| Windows 运行时 | .NET |
|---|---|
| 布尔值 | System.Boolean |
| Byte | System.Byte |
| Char | System.Char |
| Char16 | System.Char |
| DateTime | System.DateTimeOffset |
| 双精度 | System.Double |
| Guid | System.Guid |
| Int16 | System.Int16 |
| Int32 | System.Int32 |
| Int64 | System.Int64 |
| Object | System.Object |
| 单精度 | System.Single |
| 字符串 | System.String |
| TimeSpan | System.TimeSpan |
| UInt8 | System.Byte |
| UInt16 | System.UInt16 |
| UInt32 | System.UInt32 |
| UInt64 | System.UInt64 |
| Uri | System.Uri |
| 无效 | System.Void |
桂棹兮兰桨,击空明兮溯流光。
浙公网安备 33010602011771号