Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!portal!cup.portal.com!ts From: ts@cup.portal.com (Tim W Smith) Newsgroups: comp.lang.c Subject: Re: Grouse: What's the point of enum? Message-ID: <41440@cup.portal.com> Date: 19 Apr 91 12:41:59 GMT References: <1991Apr18.153418.13527@zoo.toronto.edu> <12236@dog.ee.lbl.gov> Organization: The Portal System (TM) Lines: 24 Wow! Both Henry Spencer and Chris Torek missed the point of enumerated types... next thing you know, getting involved in a land war in Asia will be a good idea. Anyway, the real point is to allow lower case names for constants. If you try this in a header file: #define opened 1 #define closed 2 everyone will scream that you should have said #define OPENED 1 #define CLOSED 2 whereas, if you instead go enum state { opened=1, closed }; people who read the code will be so busy trying to remember what the heck and 'enum' is that they won't realize you've snuck in lower case constant names. Tim Smith