06.03.2019, 16:57
enum e_PLAYER_FLAGS (<<= 1)
What does it mean?
What does it mean?
enum E (<<= 1)
{
E1 = 1,
E2,
E3,
E4
}
enum E
{
E1 = 1, //0b1
E2 = 1 << 1, //0b10
E3 = (1 << 1) << 1, //0b100
E4 = ((1 << 1) << 1) << 1 //0b1000
}
It is a way of specifying how the consequent values in an enum get assigned. These two enums are equivalent:
pawn Код:
pawn Код:
|