Possible Duplicate:
How to perform rotate shift in C
Bitwise rotate left function
In C/C++ I have <<
and >>
as left shits and right shifts respectively.
To test the function of this operator, I want to find the first set bit of a number n
, do a left shift by 1 and then do the |
of the shifted number with the first bit I found previously.
How should I do this?