17.6. .NET Base Class Library, C#, and CIL Data Type Mappings
Table 17-4 illustrates how a .NET base class type maps to the corresponding C# keyword, and how each C# keyword maps into raw CIL. As well, Table 17-4 documents the shorthand constant notations used for each CIL type. As you will see in just a moment, these constants are often referenced by numerous CIL opcodes.
.NET Base Class Type | C# Keyword | CIL Representation | CIL Constant Notation |
---|---|---|---|
System.SByte | sbyte | int8 | I1 |
System.Byte | byte | unsigned int8 | U1 |
System.Int16 | short | int16 | I2 |
System.UInt16 | ushort | unsigned int16 | U2 |
System.Int32 | int | int32 | I4 |
System.UInt32 | uint | unsigned int32 | U4 |
System.Int64 | long | int64 | I8 |
System.UInt64 | ulong | unsigned int64 | U8 |
Get Pro C# 2010 and the .NET 4 Platform, Fifth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.