python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Question about Bitwise Shift in Microsoft C++
I am doing the following bitwise shift in Microsoft C++:
uint8_t arr[3] = {255, 255, 255};
uint8_t value = (arr[1] << 4) >> 4;
The result of these operations confused me quite a bit:
valu...
Runsheng Ma
Votes: 0
Answers: 2
What is wrong with this code? The answer should be 24 for this question right?
What is wrong with this code? The answer should be 24 for this question right?
int t;
vector<int>arr={24,434};
for(int i=arr.size()-1;i>=(arr.size()-2);i--)
{
t=i;
}
cout<<a...
Himanshu Chand
Votes: 0
Answers: 2
Why is the expression true after bit shifting the value and condition with && in C
Have a look at the example:
unsigned char c = 64; /* 0100 0000 */
c = (c << 2 && 512); /* 512: 10 0000 0000 */
If I shift c two times to the left, I should get from 0100 0000 (64) to t...

B0r1
Votes: 0
Answers: 3