Something new in enums
#4

afaik, this method is for checking a bit for true or false. if iam not wrong, its possible to store 32 teams in a single cell this way. (4 bytes == 32 bits)..
oh, iam not sure about the enumerator increasement.. the <<= is a logical shift, isnt it? so the enum would power up the values by shifting the "adressed" bit to be these values: 1, 2, 4, 8, 16, 32.. so 0b00000001=TEAM_COP, 0b00000010=TEAM_ROBBER, and 0b00000100=TEAM_CIV...
0b00000111 would be 7 (1+2+4), or the 3 teams gathered together
Reply


Messages In This Thread
Something new in enums - by wups - 29.08.2011, 10:27
Re: Something new in enums - by Darnell - 29.08.2011, 10:31
Re: Something new in enums - by wups - 29.08.2011, 10:31
Re: Something new in enums - by Babul - 29.08.2011, 10:46
Re: Something new in enums - by wups - 29.08.2011, 11:24
Re: Something new in enums - by Bakr - 29.08.2011, 11:30
Re: Something new in enums - by wups - 29.08.2011, 11:31
Re: Something new in enums - by Bakr - 29.08.2011, 11:46

Forum Jump:


Users browsing this thread: 1 Guest(s)