C 的基本位元操作符號 vs byte資料型態

i=24 , 以二進位表示 0000000000011000
i=16, 以二進位表示 0000000000010000

(1) & 且
0000000000011000
& 0000000000010000
——————————
0000000000010000=16

(2) | 或
0000000000010000
| 0000000000011000
——————————
0000000000011000=24

(3) ~ 反
~ 0000000000010000
——————————-
0000000000011000
1111111111100111 =-25

item 3 很少在 APP. 裡看到 , 但在寫 BIOS 時就比較常用到了!

Share your vote!


Do you like this post?
  • Fascinated
  • Happy
  • Sad
  • Angry
  • Bored
  • Afraid

Leave a Reply

Your email address will not be published. Required fields are marked *


Please help to input verification code