Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watdaisy.UUCP Path: utzoo!watmath!water!watdaisy!ndiamond From: ndiamond@watdaisy.UUCP (Norman Diamond) Newsgroups: net.lang.c Subject: Re: Set type Message-ID: <6990@watdaisy.UUCP> Date: Wed, 20-Feb-85 16:50:42 EST Article-I.D.: watdaisy.6990 Posted: Wed Feb 20 16:50:42 1985 Date-Received: Mon, 25-Feb-85 15:16:28 EST References: <10983@watmath.UUCP> <21000020@uiucuxc.UUCP> Organization: U of Waterloo, Ontario Lines: 24 > Creating sets in C is easy. To declare set element, use #define: > > #define RED 01 > #define BLUE 02 > #define GREEN 04 > > C has a union operator ("|"), an intersection operator ("&"), and even > a set difference operator ("&~"). Of course, this approach limits you > to sets which contain no more elements than are contained in an integer, > but this limitation also tends to apply to PASCAL sets. > Kenneth Almquist That limitation does not apply to most PASCAL sets. The vast majority of PASCAL compilers allow sets large enough to support SET OF CHAR, but their integers are not >= 127 bits in size. -- Norman Diamond UUCP: {decvax|utzoo|ihnp4|allegra|clyde}!watmath!watdaisy!ndiamond CSNET: ndiamond%watdaisy@waterloo.csnet ARPA: ndiamond%watdaisy%waterloo.csnet@csnet-relay.arpa "Opinions are those of the keyboard, and do not reflect on me or higher-ups."