How to reverse bitwise AND (&) in C?

前端 未结 4 1802
一生所求
一生所求 2020-12-06 01:21

How to reverse bitwise AND (&) in C?

For example I have an operation in C like this:

((unsigned int)ptr & 0xff000000))

The

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-06 01:40

    Impossible. Bitwise & of 0xff000000 is a lossy operation. You lose the lower 24-bits permanently.

提交回复
热议问题