I'm confused about this bitwise operation including the symbol |
and how the shift left and shift right work in this example of code to reverse the int below:
uint16_t swap_uint16( uint16_t val )
{
return (val << 8) | (val >> 8 );
}
So what I understand is the << shifts the int left and >> shifts it right. I'm not sure how the |
works with these two shift operations.