#define FLAG_ONE 1
#define FLAG_TWO 2
#define FLAG_THREE 4
#define FLAG_FOUR 8
and so on for the number of flags you need. You'd also want to call them something more descriptive so you know what they do. Now, to turn a flag on, simply use the bitwise OR operator:
char flags = 0;
flags |= FLAG_ONE; // turns flag one on
You can also enable multiple flags by ORing them together:
flags |= FLAG_TWO | FLAG_THREE | FLAG_FOUR;
To check flag status use the bitwise AND operator:
if(flags & FLAG_THREE) ...
To remove a flag you can either use bitwise XOR, or AND with the one's complement of the flag. The only difference here is that with XOR the flag has to be on to be turned off (if it's already off, it gets toggled back on).
flags ^= FLAG_ONE; // flag one is toggled
flags &= ~FLAG_ONE; // flag is turned off
That's about all there is to it. Good luck!
Regards
Starfall