Skip to Content
Microsoft® Visual C#® 2005 Step by Step
book

Microsoft® Visual C#® 2005 Step by Step

by John Sharp
October 2005
Beginner content levelBeginner
592 pages
15h 2m
English
Microsoft Press
Content preview from Microsoft® Visual C#® 2005 Step by Step

Chapter 9. Creating Value Types with Enumerations and Structs

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.

In Chapter 8, you learned about the two fundamental kinds of 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 write your own classes, thus creating your own reference types. In this chapter, you’ll learn how to write your own value types.

C# supports two kinds of value types: enumerations and structures.

Working with Enumerations ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft® Visual C#® 2010 Step by Step

Microsoft® Visual C#® 2010 Step by Step

John Sharp
Professional C# 2005

Professional C# 2005

Christian Nagel, Bill Evjen, Jay Glynn, Karli Watson, Morgan Skinner, Allen Jones

Publisher Resources

ISBN: 0735621292Supplemental ContentErrata