Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!ptsfa!lll-lcc!rutgers!dayton!rosevax!rose3!starfire!merlyn From: merlyn@starfire.UUCP Newsgroups: comp.lang.c Subject: enum - enum ? Message-ID: <139@starfire.UUCP> Date: Wed, 3-Jun-87 12:31:55 EDT Article-I.D.: starfire.139 Posted: Wed Jun 3 12:31:55 1987 Date-Received: Sat, 6-Jun-87 11:07:29 EDT Organization: Starfire Consultings Services, Mpls., MN Lines: 19 What does the current standard say about enum - enum (both same enum type)? I have tried this with 2 compilers; one complained about using enums in an expression (needs cast to int), the other one didn't. I think it would be reasonable for enum - enum to be an integer value, just as ptr - ptr is, and for similar reasons; you want the 'distance' between them. This would also imply enum + int == enum and enum++ is ok Of course, if you do: enum color {red=99, blue=-4, green=200}; then green-red will be 101, not 2, and red++ != blue, but that's your doing. I know (int) green - (int) red will always work, but it's ugly. If enums are too strongly typed (what is this, Pascal?) people will go back to lists of #defines. ----- "Oh carrots! Oh crumbs!" Merlyn Leroy ...rutgers!dayton!rosevax!rose3!starfire!merlyn