Ideas for making a function for counting number of zero's in a bit string in C?
Can I make a function int bitParity(int x) that returns 1 开发者_运维知识库if x contains an odd number of 0's using only these operators? ! ~ & ^ | + << >>
Hey, it was exactly three clicks. google -> 1.st result - wiki/Parity_bit -> external link -> http://graphics.stanford.edu/~seander/bithacks.html#ParityNaive
精彩评论