Getting the number of elements in an enumerated type.

Brother Bagger akcs.bagger at vpnet.chi.il.us
Sat Oct 27 15:55:04 AEST 1990


	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



More information about the Comp.lang.c mailing list