[Solved] what does this code do? and how it will look on dart? [duplicate]


&= means take only the bits that are set to 1 in both operands

~ reverses all bits,

<< moves the bits to the left n times,

| combines bits from operands

so

hour = (bufm[1] &= ~((1 << 7) | (1 << 6) | (1 << 5))); // 128, 64, 32
hour = (bufm[1] &= ~(128 | 64 | 32)); // ~0x000000E0, reverse bits
hour = (bufm[1] &= 0xFFFFFF1F); // keep only those bits, ie. remove bits 5 6 7

I assume hour is an int (32 bits).
It removes bit 5, 6 and 7 from bufm[1] and stores it in hour.

0

solved what does this code do? and how it will look on dart? [duplicate]