So I'm getting an unsigned int passed into my function. Now I must obtain the n LSB bits of that integer and use it to access a location in an array of size 2^n
.
So for example, if my array is of size 1024, n = 10.
I am currently doing this:
unsigned int location = my_unsigned_int << n;
However this doesn't work as location
ends up being way too large and out of bounds.