O'Reilly logo

Visual C#® 2012: How to Program, Fifth Edition by Harvey Deitel, Paul Deitel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

19.2. Simple-Type structs, Boxing and Unboxing

The data structures we discuss in this chapter store object references. However, as you’ll soon see, we’re able to store both simple- and reference-type values in these data structures. This section discusses the mechanisms that enable simple-type values to be manipulated as objects.

Simple-Type structs

Each simple type (see Appendix B, Simple Types) has a corresponding struct in namespace System that defines the simple type. These structs are called Boolean, Byte, SByte, Char, Decimal, Double, Single, Int16, UInt16 Int32, UInt32, Int64 and UInt64. Types declared with keyword struct are value types.

Simple types are actually aliases for their corresponding structs, so a variable of a simple type ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required