• Welcome to Valhalla Legends Archive.
 

[C++] User access flags (bitmasking?)

Started by warz, March 18, 2006, 01:31 PM

Previous topic - Next topic

warz

I haven't done a moderation bot in forever. Infact, I don't think I've made one in C++. Anywho, I remember reading on certain forums about access flags, and turning them into hex values, or something. Apparantly it makes it easier to deal with?

Anyone know about this? Or can explain how this works..


warz

#2
Alright, I'm pretty sure I understand this. How would you go, though, from the bitfield back to the A-Z equiv?

Eric

if ((mask & FLAG_S) == FLAG_S)
{
    // S flag
}

if ((mask & FLAG_B) == FLAG_B)
{
    // B flag
}

...