Implementing sets in C

John W. DeBoskey jwd at sas.UUCP
Tue Dec 19 05:05:17 AEST 1989


Hello All,

   I've tried and painfully failed to implement a GOOD efficient 
method of the Pascal Sets in C. What I'd like to do is something
of the form:

       do {
          ch = process_string(somestring,someoffset,etc);
       while (ch IN('a'..'z','*'));

   I know I can do this with a series of OR operators, but there
must be an easier way to set this up as a pair of macros such as
IN() & NOTIN(), where the SETS passed in could be bit arrays.
Unfortunately, I've run out of ideas.

   If you have any ideas, I'd really appreciate hearing from
you. Please repsond to {backbone}!mcnc.mcnc.org!baggins!jwd
if you could. I'll post any final up & running code to do
this (if I ever can). Thanks Alot!!
                                      John W De Boskey

jwd at sas.UUCP     (w) jwd%sas at rti.rti.org
jwd at baggins.UUCP (h) jwd%baggins at mcnc.mcnc.org



More information about the Comp.lang.c mailing list