O'Reilly logo

Microsoft® Visual C#® 2012 Step by Step by John Sharp

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

Chapter 9. Creating Value Types with Enumerations and Structures

After completing this chapter, you will be able to

  • Declare an enumeration type.

  • Create and use an enumeration type.

  • Declare a structure type.

  • Create and use a structure type.

  • Explain the differences in behavior between a structure and a class.

In Chapter 8, you learned about the two fundamental types that exist in Microsoft Visual C#: value types and reference types. A value type variable holds its value directly on the stack, whereas a reference type variable holds a reference to an object on the heap. In Chapter 7, you learned how to create your own reference types by defining classes. In this chapter, you’ll learn how to create your own value types.

C# supports two kinds of value types: ...

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