Parameters in the enum function
#2

The operator "<<" it's a bitwise shift operator, the code you posted is used to make "Bit Flags"
PHP код:
enum E_MY_TAG (<<= 1)
{
E_MY_TAG_NONE,         //0b00000000000000000000000000000000 = 0
E_MY_TAG_VAL_1 1,  //0b00000000000000000000000000000001 = 1
E_MY_TAG_VAL_2,        //0b00000000000000000000000000000010 = 2
E_MY_TAG_VAL_3,        //0b00000000000000000000000000000100 = 4
E_MY_TAG_VAL_4         //0b00000000000000000000000000001000 = 8

If you want to learn more about bit flags check this topic: https://sampforum.blast.hk/showthread.php?tid=216730
Reply


Messages In This Thread
Parameters in the enum function - by NguoiChauA - 15.05.2017, 08:35
Re: Parameters in the enum function - by Aviicix - 16.05.2017, 14:01

Forum Jump:


Users browsing this thread: 1 Guest(s)