I'm writing an iPhone app that's a mixture of Objective-C and C. I have 32-bit integer flags throughout my code that take on only two distinct values: 0 and 1. I'd like to use a data type that's smaller than 32 bits.
Is there a type that's only one bit? What is the size of "BOOL" in Objective-C?
One solution I've considered is using one 32-bit integer for a group of 32 flags... then checking each flag in the following way:
if(ALL_FLAGS & (1 << SPECIFIC_FLAG)){...}
I'd really like to use just a "bit" type though.
Cheers!