Enumerated types... what's the point?

Brian Matthews 6sigma2 at polari.UUCP
Sat Mar 24 10:27:37 AEST 1990


In article <1990Mar22.164943.10459 at utzoo.uucp> henry at utzoo.uucp (Henry Spencer) writes:
|Enumerated types were basically a kludge.  X3J11 seriously debated leaving
|them out entirely.  Arguments about not breaking existing code, etc, led
|to them being left in, but as a flavor of integer rather than as real live
|independent types.  That's all they ever were in C.

For some C compilers, your last sentence isn't true.  pcc2's enums weren't
interchangable with integers, although they weren't full separate types with
separate name spaces and such either.  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.)
-- 
Brian L. Matthews	blm at 6sceng.UUCP



More information about the Comp.lang.c mailing list