eennuumm -- C Keyword

Declare a type and identifiers

An eennuumm  declaration is  a data  type whose syntax  resembles those  of the
ssttrruucctt and uunniioonn declarations.  It lets you enumerate the legal value for a
given variable.  For example,

    enum opinion {yes, maybe, no} GUESS;

declares type ooppiinniioonn can have one  of three values: yyeess, nnoo, and mmaayybbee. It
also declares the variable GGUUEESSSS to be of type ooppiinniioonn.

As with a ssttrruucctt or uunniioonn declaration, the tag (ooppiinniioonn in this example) is
optional;  if present,  it  may be  used in  subsequent declarations.   For
example, the statement

    register enum opinion *op;

declares a register pointer to an object of type ooppiinniioonn.

All enumerated  identifiers must be distinct from  all other identifiers in
the  program.   The  identifiers act  as  constants  and  be used  wherever
constants are appropriate.

COHERENT assigns  values to  the identifiers  from left to  right, normally
beginning  with zero  and increasing  by  one.  In  the above  example, the
values of yyeess, nnoo, and mmaayybbee are set, respectively, to one, two, and three.
The values often are iinntts, although if the range of values is small enough,
the eennuumm will  be an uunnssiiggnneedd cchhaarr. If an  identifier in the declaration is
followed by  an equal sign and  a constant, the identifier  is assigned the
given value,  and subsequent  values increase by  one from that  value; for
example,

    enum opinion {yes=50, no, maybe} guess;

sets the  values of the identifiers  yyeess, nnoo, and mmaayybbee to  50, 51, and 52,
respectively.

_S_e_e _A_l_s_o
CC kkeeyywwoorrddss
ANSI Standard, section 6.5.2.2
