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 |
桂棹兮兰桨,击空明兮溯流光。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
2020-12-12 C# Socket 端口复用