什么是掩码,掩码的用途是什么

百度收到的都不精确,看我收录老外的一段话,这才准确:

A mask defines which bits you want to keep, and which bits you want to clear.

Masking is the act of applying a mask to a value. This is accomplished by doing:

1、Bitwise ANDing in order to extract a subset of the bits in the value
2、Bitwise ORing in order to set a subset of the bits in the value
3、Bitwise XORing in order to toggle a subset of the bits in the value

posted @ 2016-06-22 09:20  安子  阅读(1878)  评论(0编辑  收藏  举报