Trying to convert a C program to Javascript since I found the old source code. The only thing I learn C when I go, but the hardest part is to be fresh to the language - you don’t know exactly what terms are for Google. Anyway,
I have this bit of code:
unsigned long long flag=0;
if (class[1]=='W') flag|=CF_WARRIOR;
else flag|=CF_MAGE;
The header file says
#define CF_WARRIOR (1ull<<16)
Then its last part:
(unsigned int)(flag&0xffffffff)
Just not sure what the programmer was trying to execute at that time.
Sorry for the bad question, but I don’t know exactly what Google should do to understand this, I understand that it 1ullis 1 unsigned long long and << 16is a bitwise shift. But not sure what he is doing |=, or flag&0xffffffff. Thanks.
source
share