用C;如何扭转位与(AMP)? [英] How to reverse bitwise AND (&) in C?
本文介绍了用C;如何扭转位与(AMP)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何扭转位与(安培)?用C
How to reverse bitwise AND (&) in C?
例如我用C这样的操作:
For example I have an operation in C like this:
((unsigned int)ptr & 0xff000000))
结果是 0xbf000000
。我需要在这一刻是如何扭转以上情况,即确定 PTR
通过从操作和结果当然 0xff000000
。
The result is 0xbf000000
. What I need at this moment is how to reverse the above, i.e. determine ptr
by using the result from the operation and of course 0xff000000
.
有没有用C实现这个什么简单的办法?
Is there any simple way to implement this in C?
推荐答案
按位&安培;
不能颠倒:
0 & 1 = 0
0 & 0 = 0
这篇关于用C;如何扭转位与(AMP)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文