Cast the number to unsigned
and then shift. That will force a 0-fill.
More Related Contents:
- Bit manipulation, return 0 if x != 0, or nonzero otherwise
- What is Bit Masking?
- Are the results of bitwise operations on signed integers defined?
- Operator precedence (bitwise ‘&’ lower than ‘==’)
- Getting each individual digit from a whole integer
- Casting float to int (bitwise) in C
- What does the statement if (counter & (1
- Bitwise ‘&’ operator
- Encoding int value as an IEEE-754 float (binary32)
- Why use the Bitwise-Shift operator for values in a C enum definition?
- How to get position of right most set bit in C
- Decimal to Binary
- What is bit masking?
- How do I make this Linux program compile? [closed]
- Update a struct in Arduino
- Why My DeCompression is showing an Error?
- What is the difference between ‘asm’, ‘__asm’ and ‘__asm__’?
- do { … } while (0) — what is it good for? [duplicate]
- Determining endianness at compile time [duplicate]
- Why do I first have to strcpy() before strcat()?
- Return value of “==” operator in C
- Working of __asm__ __volatile__ (“” : : : “memory”)
- Can popen() make bidirectional pipes like pipe() + fork()?
- Are C-structs with the same members types guaranteed to have the same layout in memory?
- find if 4 points on a plane form a rectangle?
- Strange array initialize expression?
- How can I get a filename from a file descriptor inside a kernel module?
- C: Correctly freeing memory of a multi-dimensional array
- Paint Pixels to Screen via Linux FrameBuffer
- C Memory Management