2-7

xiaoxiao2021-03-06  52

/ *

Write a function invert (x, p, n), which returns the result value after the following operation:

The N b binary position started from the first bit (i.e., 1 change 0, 0 change 1), and the remaining points of X remain unchanged.

* /

INT INVERT (int X, int P, int N)

{

Return (x ^ (~ (~ 0 << n) << p));

}

转载请注明原文地址:https://www.9cbs.com/read-117395.html

New Post(0)