Search:

Type: Posts; User: ddang

Search: Search took 0.00 seconds.

  1. Replies
    5
    Views
    1,201

    if ( (word >> (31 - n)) & 0x1 ) So if the...

    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...
  2. Replies
    5
    Views
    1,201

    Oh. I actually didn't understand the question...

    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...
  3. Replies
    5
    Views
    1,201

    Confused about this code regarding bits

    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...
Results 1 to 3 of 3