Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!mephisto!ncsuvx!news From: dks@shumv1.uucp (D. K. Smith) Newsgroups: comp.lang.c Subject: Enumerated types... what's the point? Keywords: enums Message-ID: <1990Mar22.053148.10351@ncsuvx.ncsu.edu> Date: 22 Mar 90 05:31:48 GMT Sender: news@ncsuvx.ncsu.edu (USENET News System) Reply-To: dks@shumv1.ncsu.edu (D. K. Smith) Distribution: usa Organization: NCSU Computing Center Lines: 34 I thought... How nice! These enumaerated types allow me "type check" myself when I am using them for distinguishing between different variable types that possess similar data structures. For example: typedef enum { subjPoly=0, clipPoly } PolyKind; typedef enum { insidePoly=0, outsidePoly } DisplayKind; However, to my surprise, I discovered that I could interchange these critters among themselves as well as with Booleans! Is this what is supposed to happen? I have not RTFM'd the C scriptures but my immediate reaction is "what's the point!...I could just as easily used #define and accomplished the same thing. I guess I am supposed to conclude that an int is an int is an int... no matter what kind of label you put on it?!? dk smith ------------------------------------------------------------------------ dks@shumv1.ncsu.edu | ude.uscn.1vmuhs@skd -my opinions reflect my opinions. | .snoinipo ym tcelfer snoinipo ym- ------------------------------------------------------------------------