By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,098 Members | 1,893 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,098 IT Pros & Developers. It's quick & easy.

Bit masking in C???

P: 7
I can not understand how to implement bit masking on a c code?? while working with array it is taking too much time.................. so i need help.
i need some suggestion and sample code of C dealing with bit masking..............; its argent............. plz help me.
Dec 14 '09 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 2,400
Take a look at this other recent bit masking thread.
Dec 14 '09 #2

P: 113
None can "urgently" answer this question. There are maths behind it. Search google for binary logic and examples of bitwise operations. I then suggest to look for "NOT", "AND", "OR" and "XOR" operations and their truth tables. Then search how these are implemented in C (~, &, | and ^ respectively). Make a small demo program (no more than 10 lines) and test these operations. Use windows calculator for help, so that you can easily convert decimal to binary values. See if the values from these operations change according to the operator's truth table and that should be it!
Dec 15 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.