using bit flags

Started by
3 comments, last by original vesoljc 21 years, 4 months ago
if using bit flags with bitwise operators, how do we have more than 64 bits on one "variable"? ie: uint64 status_flags = 0; FLAG1 0x0000000 FLAG2 0x0000001 FLAG3 0x0000002 FLAG4 0x0000004 FLAG5 0x0000008 FLAG6 0x0000010 ... FLAG63 0x8000000 status_flags = status_flags | FLAG2; if(status_flags & FLAG2) { } so how to go bigger and/or is there a better way to handle flags?
Abnormal behavior of abnormal brain makes me normal...
Advertisement
It is unlikely that you would ever need more then 64 bitflags.
Look into std::bitset.

Member of the Unban Mindwipe Society (UMWS)
Deyja: probablly not, but if i needed 65 of them i''d go crazy
Abnormal behavior of abnormal brain makes me normal...
You use multiple flag variables and organize the flags by category.

~CGameProgrammer( );
~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.

This topic is closed to new replies.

Advertisement