Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!iuvax!purdue!haven!decuac!shlump.nac.dec.com!mountn.dec.com!labc!wallis From: wallis@labc.dec.com (Barry L. Wallis) Newsgroups: comp.lang.c Subject: Re: Enumerated types... what's the point? Summary: Is ordering defined for enums? Keywords: C, enum Message-ID: <1480@mountn.dec.com> Date: 23 Mar 90 19:49:35 GMT Sender: news@mountn.dec.com Distribution: usa Organization: Digital Equipment Corporation Lines: 24 In article <8578@pt.cs.cmu.edu>, flc@n.sp.cs.cmu.edu (Fred Christianson) writes... [ intervening text deleted ] > >But if >order is important the #defines may be better because you are immediately >aware of the order by looking at the #defines whereas you (or at least me) >don't tend to think of enum symbols as ordered. > [ intervening text deleted ] >---- >Fred Is ordering defined on type enum? I have a book on Turbo-C (can't remember the title but it's published by Howard Sams) which says that ordering on the elements of an enum is undefined. For example, enum { JAN, FEB, MAR } months would make the comparison (FEB > JAN) illegal! I don't believe this is reality in Turbo-C, but, I'm currently 1700 miles from my PC and library. --- Barry L. Wallis USENET: wallis@labc.dec.com Database Consultant Prodigy (don't laugh): DNMX41A U.S. DECtp Resource Center DECUServe: EISNER::WALLIS (not on the net yet) Los Angeles, CA "No one voted for me, I represent myself" ---