| ??? 12/25/03 22:31 Read: times |
#61394 - RE: Random number from 1 to 8 Responding to: ???'s previous message |
& operator is a bitwise operator while && is the logical AND. in your example you mean the & for bitwise.
I see what you mean now, by discarding the upper 5 bits I get a number from 0 to 7. so it should be ok to do newRand = 1 + rand() & 7; thanks |



