if ( (word >> (31 - n)) & 0x1 )
So if the argument inside the if statement is 1, then 1 is returned.
The word is shifted over 31-n places to the right. If the value anded with 1 results in 1, it...
Type: Posts; User: ddang
if ( (word >> (31 - n)) & 0x1 )
So if the argument inside the if statement is 1, then 1 is returned.
The word is shifted over 31-n places to the right. If the value anded with 1 results in 1, it...
Oh. I actually didn't understand the question "Have the function return 1 bit number n if it is on inside the
word, and 0 if it is off." That is pasted verbatim, but is there a typo? I don't...
Part of an exercise in my book requests "Write a function called bit_test that takes two arguments: an unsigned int anda bit number n. Have the function return 1 bit number n if it is on inside the...