jayanth.devarayanadurga
Banned
- Joined
- Dec 4, 2012
- Messages
- 4,280
- Helped
- 822
- Reputation
- 1,654
- Reaction score
- 791
- Trophy points
- 1,393
- Location
- Bangalore, India
- Activity points
- 0
In C/C++ SHL and SHR operators <<, >> move bits to left or right like below.
If x is a char variable and contains 0b11100000 then x = x << 1 and x = x >> 1 shifts bits one place to left and right so the result is x = 0b11000001 and 0b011100000. Right?
In assembly language it tells that it will pad zeroes to right or left like it becomes 0b11000000 and 0b00111000.
If x is a char variable and contains 0b11100000 then x = x << 1 and x = x >> 1 shifts bits one place to left and right so the result is x = 0b11000001 and 0b011100000. Right?
In assembly language it tells that it will pad zeroes to right or left like it becomes 0b11000000 and 0b00111000.
Last edited: