Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!bacchus.pa.dec.com!shlump.nac.dec.com!tkou02.enet.dec.com!diamond From: diamond@tkou02.enet.dec.com (diamond@tkovoa) Newsgroups: comp.lang.c Subject: Re: typedef enum as subset of another enum Keywords: typedef, enum Message-ID: <1827@tkou02.enet.dec.com> Date: 30 Jun 90 03:37:37 GMT References: <1256@metaphor.Metaphor.COM> Reply-To: diamond@tkou02.enet.dec.com (diamond@tkovoa) Distribution: na Organization: Digital Equipment Corporation Japan , Tokyo Lines: 14 In article <1256@metaphor.Metaphor.COM> barry@lizard.metaphor.com (Barry Friedman) writes: >I want to create two enumerated types, one being a subset of the >other, something like this: >typedef enum { a, b, c, d, e } Set; /* This defines the full set */ >typedef enum { b, c, d } SubSet; /* This is a subset of above */ typedef enum { a, b, c, d, e } Set; /* This defines the full set and more */ typedef Set SubSet; /* This does too */ If you want subranges (such as limiting Set to the range a..e, let alone what you want to do to SubSet), then you have to use another language. -- Norman Diamond, Nihon DEC diamond@tkou02.enet.dec.com This is me speaking. If you want to hear the company speak, you need DECtalk.