Number of enums

Chip Salzenberg chip at tct.uucp
Thu Jan 24 04:23:08 AEST 1991


According to dave at cs.arizona.edu (Dave P. Schaumann):
>Of course, the optimal solution would be for ANSI to adopt a 'numberof'
>with functionality similar to 'sizeof', so that you could say 
>numberof(ThingList) to get the number of values.

Hardly.  Given:

    typedef enum {
	CORGE = -100, QUUX = -50,
	LARRY = 1, MOE = 2, CURLY = 4, JOE = 9,
	EX_PARROT = 32767
    } PLUGH;

Of what use would numberof(PLUGH) be?
-- 
Chip Salzenberg at Teltronics/TCT     <chip at tct.uucp>, <uunet!pdn!tct!chip>
       "If Usenet exists, then what is its mailing address?"  -- me
             "c/o The Daily Planet, Metropolis."  -- Jeff Daiell



More information about the Comp.lang.c mailing list