Can someone explain to me how does variables like that works?
Definition:
Code:
#define VOTE_IN_PROGRESS 1
#define VOTE_FORCED 2
#define VOTE_IS_RUNOFF 4
#define VOTE_IS_OVER 8
#define VOTE_IS_EARLY 16
#define VOTE_HAS_EXPIRED 32
#define VOTE_OUTCOME 64
Usage:
check: g_voteStatus & VOTE_IS_RUNOFF
add: g_voteStatus |= VOTE_IS_RUNOFF
remove: g_voteStatus |= ~VOTE_IS_RUNOFF
f.e. If I'll add VOTE_OUTCOME to g_voteStatus it will be 64. It means that previous variables are already inside g_voteStatus?
g_voteStatus |= VOTE_IS_OUTCOME
and g_voteStatus & VOTE_IS_OVER will return true?