roll binary c

Solutions on MaxInterview for roll binary c by the best coders in the world

showing results for - "roll binary c"
Aubin
06 Jan 2017
1// U can change the type by changing char to int
2unsigned char rol(unsigned char value, unsigned char roll)
3{
4    roll = roll % sizeof(char) * 8;
5    unsigned char mask_rolld = ~(0xFF >> roll);
6    unsigned char lmb = (mask_rolld & value) >> (sizeof(char) * 8 - roll);
7    return (value << roll) | lmb;
8}
9
queries leading to this page
roll binary croll binary c