How many values in an enum (Was: Enumerated types... what's the point?)

Robert J. Drabek robert at cs.arizona.edu
Fri Mar 30 10:31:10 AEST 1990


> |How do you get the compiler to tell you how many values an enumerated
> |type has?  Does this just refer to defining a final value, like
> |enum days_of_week = {SUNDAY, MONDAY, TUESDAY, WEDNESDAY,
> |		     THURSDAY, FRIDAY, SATURDAY, N_DAYS_OF_WEEK };


Or:
   (SATURDAY - SUNDAY + 1)
-- 
Robert J. Drabek                            robert at cs.Arizona.EDU
Department of Computer Science              uunet!arizona!robert
The University of Arizona                   602 621 4326
Tucson, AZ  85721



More information about the Comp.lang.c mailing list