Enumerated types... what's the point?
Barry L. Wallis
wallis at labc.dec.com
Sat Mar 24 05:49:35 AEST 1990
In article <8578 at pt.cs.cmu.edu>, flc at 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 at 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"
---
More information about the Comp.lang.c
mailing list