Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: How to do sets? Message-ID: <1989Mar15.164848.21512@utzoo.uucp> Organization: U of Toronto Zoology References: <518taylorj@yvax.byu.edu> Date: Wed, 15 Mar 89 16:48:48 GMT In article <518taylorj@yvax.byu.edu> taylorj@yvax.byu.edu writes: >Is there a way to do sets in C (like in Pascal)? That is, check for set >inclusion (char in ["0".."9"]), and perform unions and intersections. And the >answer is not "use bitwise operators," I already know how to do that and would >rather not if there's an easier way, especially with large sets requiring 32 >bytes or more. Why are you averse to bitwise operators? That's how Pascal sets are almost invariably implemented. One can write C preprocessor macros that cover up the details in somewhat the same way that Pascal does. -- Welcome to Mars! Your | Henry Spencer at U of Toronto Zoology passport and visa, comrade? | uunet!attcan!utzoo!henry henry@zoo.toronto.edu