creating a function to test bits in a byte, and it returns

Discussion in 'C Programming' started by DJ, Jan 4, 2008.

  1. DJ

    DJ Guest

    Hi all,
    I just started c programming recently and facing a bit harder
    questions. I'm wondering if anyone can help me get started with this
    question. I did learn bit shifting, setting and resetting but don't
    how to apply the idea to the question. Thank u much DJ
    A function that tests bits in a byte, and it returns:
    a) success or failure,
    b) count of bits that are set ("==") in the byte,
    c) position of bit(s) in the byte.
     
    DJ, Jan 4, 2008
    #1
    1. Advertising

  2. DJ <> wrote:
    > Hi all,
    > I just started c programming recently and facing a bit harder
    > questions. I'm wondering if anyone can help me get started
    > with this question. I did learn bit shifting, setting and
    > resetting but don't how to apply the idea to the question.
    > Thank u much DJ
    > A function that tests bits in a byte, and it returns:
    > a) success or failure,
    > b) count of bits that are set ("==") in the byte,
    > c) position of bit(s) in the byte.


    http://c-faq.com/

    I also recommend using the 'search this group' option
    available with the Google Groups interface.

    --
    Peter
     
    Peter Nilsson, Jan 4, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. GGG
    Replies:
    10
    Views:
    12,635
    Donar
    Jul 6, 2006
  2. sarmin kho
    Replies:
    2
    Views:
    840
    A. Lloyd Flanagan
    Jun 15, 2004
  3. Miki Tebeka
    Replies:
    1
    Views:
    452
    Marcin 'Qrczak' Kowalczyk
    Jun 14, 2004
  4. sergey

    "casting" bits to bits?

    sergey, Nov 8, 2006, in forum: VHDL
    Replies:
    1
    Views:
    720
    sergey
    Nov 8, 2006
  5. Tomás

    Value Bits Vs Object Bits

    Tomás, Jun 2, 2006, in forum: C Programming
    Replies:
    13
    Views:
    555
    Hallvard B Furuseth
    Jul 1, 2006
Loading...

Share This Page