Built-In Types

Classes and structs can be used to define new reference or value types, respectively, by defining fields for data storage. As you saw previously, fields are classified as variables, and all variables have a type. Guess what? We just spotted a recursive definition: Value types and reference types are composed of other types.

Clearly, this recursive definition needs to stop somewhere with a base case. In other words, some primitive types should be available that cannot be decomposed any further by means of fields. One way to determine such types is by looking at the types the CLR natively knows about in terms of intermediate language (IL) instructions (for example, for addition of two integers of floating-point numbers).

Actually, ...

Get C# 4.0 Unleashed 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.