I am trying to get the range of bits from a number. For example , if I call bitRange(0x00001234, 0 , 4). I will get 0x00000004; 0x00001234 is the number i want to the range of bits from. 0 is the starting position. 4 is the number of bits to get from the number.
Step 1: To extract the bits from the hexadecimal number we need to use the shift operator and use bitwise operation in C.
Sorry about that. What wasn’t helpful?