If you do not need millions of these flags or are limited by a memory limit, the best way is finally int .
This is because int usually matches the size of the natural word of your platform and can be correctly aligned by reference. The machine reads the word at any time, and the use of individual bits requires camouflage and offset, which takes time. On your typical PC with gigabytes of RAM, that would be just plain stupid.
If the memory problem is really a problem, bitfield structures exist.
Felix palmen
source share