Study Notes (46): C # fast entry - declare enumeration and use

Learning immediately: https://edu.csdn.net/course/play/20589/257756?utm_source=blogtoedu

Enumerated type

Determine the number, determine the value of several values: seasons, men and women, Monday, two hundred and thirty-four thousand five hundred sixty-seven

1. Syntax:

enum 枚举名
{
    值1,
    值2,
    ……
}

2. Assignment

    Enumeration name variable name = name enumeration value of 1

3. enumerated benefits: can define a range of values, the specification values, being given out of range

Published 34 original articles · won praise 0 · Views 302

Guess you like

Origin blog.csdn.net/u013162262/article/details/104881093