So I see that this question has already been asked, however the answers were a little vague and unhelpful. Okay, I need to implement a c expression using only \"& ^ ~ ! + |
In other words, you need a to have all bits set to 0, if a is false (i.e. 0), and have all bits set to 1, if a is true (i.e. a > 0).
a
false
a > 0
For the former case, the work is already done for you; for the latter -- try to work out result of the expression ~!1.
~!1