sizeof (enum) == ? - (nf)

notes at ucbcad.UUCP notes at ucbcad.UUCP
Thu Oct 27 04:03:11 AEST 1983


#N:ucbesvax:4800029:000:459
ucbesvax!turner    Oct 26 05:51:00 1983

	I have a question about enum types.  What size are they?
Ritchie says that his compiler treats them as ints.  But what about
pcc?  Are they sizeof int or sizeof char *?  The latter would be
preferable to me, since I am using enum's to hide pointers from the
users of a package; for this to work across all machines, enum
types must be (at least) as large as the largest possible pointer-
size.

Thanks in advance,
    Michael Turner (ucbvax!ucbesvax.turner)



More information about the Comp.lang.c mailing list