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

D

DJ

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.
 
P

Peter Nilsson

DJ said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,145
Latest member
web3PRAgeency
Top