Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think!snorkelwacker!mit-eddie!uw-beaver!sumax!thebes!polari!6sigma2 From: 6sigma2@polari.UUCP (Brian Matthews) Newsgroups: comp.lang.c Subject: Re: How many values in an enum (Was: Enumerated types... what's the point?) Message-ID: <1472@polari.UUCP> Date: 29 Mar 90 18:17:36 GMT References: <1990Mar22.053148.10351@ncsuvx.ncsu.edu> <1990Mar22.164943.10459@utzoo.uucp> <1425@polari.UUCP> <96@motto.UUCP> Reply-To: 6sigma2@polari.UUCP (Brian Matthews) Organization: PolarServ, Seattle WA Lines: 15 In article <96@motto.UUCP> dave@motto.UUCP (David Brown) writes: |In article <1425@polari.UUCP> blm@6sceng.UUCP (Brian Matthews) writes: |>ANSI enums, on the other hand, are |>little more than fancy #defines (although you can: a - insert new ones in the |>middle without renumbering the others by hand and b - have the compiler tell |>you how many there are.) |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 }; That's all I meant. If there is something more subtle, I don't know about it. -- Brian L. Matthews blm@6sceng.UUCP