Search code examples
javacbit-manipulation

How do I perform an unsigned right shift (>>> in Java) in C/C++?


How do I perform an unsigned right shift (>>> in Java) in C/C++?


Solution

  • >>> is unsigned right shift, so I would think that in C this would be the same as

    unsigned int foo;
    unsigned int bar = foo >> whatever;