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.

Table 17.4. Mapping .NET Base Class Types to C# Keywords, and C# Keywords to CIL
.NET Base Class TypeC# KeywordCIL RepresentationCIL Constant Notation
System.SBytesbyteint8I1
System.Bytebyteunsigned int8U1
System.Int16shortint16I2
System.UInt16ushortunsigned int16U2
System.Int32intint32I4
System.UInt32uintunsigned int32U4
System.Int64longint64I8
System.UInt64ulongunsigned int64U8

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.