Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
1 110 11 に相当するバイナリ値があります。強調表示されたビットを 0 101 00 に設定する必要があります。結果の値を 1 101 11 にする必要があります。
unsigned char my_byte = 0x3B; // 0b00111011 // clear the bits my_byte &= 0xE3; // set the bits my_byte |= 0x14;
多くの人が0xE3と0x14の書き方に関して多くの異なる好みを持っていることがわかります。ビットをシフトするのが好きな人もいますが、最終的にはこれが生成されるコードです。