I would like to use binary flags to represent a mathematical set in C, where "Bit i is set" means "item i is in the Set". This is convenient because operations like "union" and "intersection" are trivial to implement ("|" and "&"). However, I want my set to be able to contain more than 32 items. Furthermore, I want my code to work on both 32 and 64 bit machines.

Is there any simple way to manipulate more than one word worth of bits in C? Is there a better way to approach this task?