Path: utzoo!attcan!uunet!cos!hqda-ai!media!vitro!fsb From: fsb@vitro.uucp (Steve Brailsford) Newsgroups: comp.lang.c Subject: more that 32 flag array testing Keywords: boolean,testing,bits Message-ID: <1990Oct8.165154.26747@vitro.uucp> Date: 8 Oct 90 16:51:54 GMT Distribution: comp Organization: Vitro Corporation Lines: 28 This talk about how many bits set in a long has reminded me of a problem I have with finding a good efficient, fast storage mechanism for storing 100 boolean flags. Basically, I have am algorithm that needs to mark one of 100 flags true, (after they have all been inited to false.) And then to scan through the flags to perform operations on those that get set. I set aside an array of 100 chars and just set each one to 0 or 1. I couldn't think of a way to use 100 bits worth of storage without it getting really hairy computationally. If I use enums and test some location, locations are maxed at 32 bits. How could I find if the 33 bit was set without having some array of longs. The problem is even more complex in the fact that the 100 comes from 10x10, a defined size. If I say it's now 20x20, I would have to write the 100 bit test stuff all over. Anyone done anything like this? Steve Brailsford Usenet: uunet!media!vitro!fsb Vitro Corporation Compu$erve: 73427,1466 14000 Georgia Ave. Voice: (301) 231-1481 Silver Spring, MD 20906 -- Steve Brailsford Usenet: uunet!media!vitro!fsb Vitro Corporation Compu$erve: 73427,1466 14000 Georgia Ave. Voice: (301) 231-1481