I noticed some strange behavior with bitshifting with brackets
#include <stdio.h>
int main(void)
{
unsigned char c;
unsigned char d;
c = 153;
c = (c << 7) >> 7;
printf("%d\n", c);
d = 153;
d = (d << 7);
d = (d >> 7);
printf("%d\n", d);
}
output:
153
1
I expected c
to also have a value of 1... whats going on? Is this undefined?