Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!jarthur!aqdata!sullivan From: sullivan@aqdata.uucp (Michael T. Sullivan) Newsgroups: comp.lang.c Subject: Re: Enumerated types... what's the point? Message-ID: <1990Mar23.234509.21638@aqdata.uucp> Date: 23 Mar 90 23:45:09 GMT References: <8578@pt.cs.cmu.edu> Distribution: usa Organization: aQdata, Inc. Western Region -- San Dimas, CA Lines: 25 I missed the beginning of this discussion so forgive me if this has been gone over but has anybody mentioned the assignment of clashing enum variables? For instance: typedef enum { red, green, brown, yellow } colors; typedef enum { huey, dewey, louie } ducks; main() { colors a; ducks b; a = red; b = huey; a = 1 a = b; } produces a compiler error at "a = 1" and "a = b". This makes sure people can't make an end run around the values a given variable should have, which they could easily do if #define's were used for the values. -- Michael Sullivan uunet!jarthur!aqdata!sullivan aQdata, Inc. sullivan@aqdata.uucp San Dimas, CA +1 714 599 9992