??? 12/18/06 22:34 Read: times |
#129701 - Bit shifting Responding to: ???'s previous message |
Can't you use a bit shift, nested in a couple of for loops
Don't use the code it's crap ie for (i = 0; i++; i<16){ //outer loop increments the bits set for (j= 0; j++; j<16){ //inner loop shifts the set bits along variable_to_shift >> j; } number_of_bits_set = i; } Obviously there is a bit more than this, but not a lot I would suspect. Don;t judge the code, it's not thought out Anyway just a thought. |