Skip to Main Content
The C# Programming Language, Third Edition
book

The C# Programming Language, Third Edition

by Anders Hejlsberg, Mads Torgersen, Scott Wiltamuth, Peter Golde
October 2008
Intermediate to advanced content levelIntermediate to advanced
784 pages
18h 11m
English
Addison-Wesley Professional
Content preview from The C# Programming Language, Third Edition

14. Enums

An enum type is a distinct value type (§4.1) that declares a set of named constants.

The example

        enum Color        {                Red,                Green,                Blue        }

declares an enum type named Color with members Red, Green, and Blue.

14.1 Enum Declarations

An enum declaration declares a new enum type. An enum declaration begins with the keyword enum, and defines the name, accessibility, underlying type, and members of the enum.

    enum-declaration:            attributesopt enum-modifiersopt enum identifier enum-baseopt enum-body ;opt

    enum-base:            :  integral-type

    enum-body:            {  enum-member-declarationsopt }            {  enum-member-declarations , }

Each enum type has a corresponding ...

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

C Programming Language, 2nd Edition

C Programming Language, 2nd Edition

Brian W. Kernighan, Dennis Ritchie
Learn C# Programming

Learn C# Programming

Marius Bancila, Prakash Tripathi, Raffaele Rialdi, Ankit Sharma
Programming C#

Programming C#

Jesse Liberty
Head First C#, 4th Edition

Head First C#, 4th Edition

Andrew Stellman, Jennifer Greene

Publisher Resources

ISBN: 9780321592279Purchase book