Hey,

I am new to C, and I'm stack on code for bitwise operation

I need to get a function (which i have a call from main) using 3 integers to say if bits in a range are all on or off

function(Number,X,Y)

where:

Number , is the integer

X is the beginning position of the range

Y is the ending position of the range

so far the only solution that i thought of was:

(((Number >> X) & 01) & ((Number >> Y) & 01))

but it doesnt seem to work.

Anyone able to help me?