Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!wuarchive!decwrl!sun-barr!olivea!orc!inews!iwarp.intel.com!gargoyle!igloo!ddsw1!obdient!vpnet!akcs.bagger From: akcs.bagger@vpnet.chi.il.us (Brother Bagger) Newsgroups: comp.lang.c Subject: Getting the number of elements in an enumerated type. Message-ID: <27290adc-5e5.1comp.lang.c-1@vpnet.chi.il.us> Date: 27 Oct 90 05:55:04 GMT References: <6837@castle.ed.ac.uk> Lines: 7 Actually its fairly simple. typedef enum {val1=0,val2,val3,val4,val5,VALUE_COUNT} values; VALUE_COUNT will equal 5 and as long as you don't change the sequental ordering or move VALUE_COUNT from the end of the list. Brian