H
Huub
Hi,
I have a problem using rand().
I've been trying to use it in 4 different ways: rand(), rand() % n, rand
() % n-1 and rand() % (high - low + 1) + low with high = 22 and low = 1.
Since rand() is pseudo-random, the results should show a returning
pattern. However, though it works fine in a little rand() test program
giving up to 8 different outcomes, in my real code using either way, the
only outcome I get is 0. Any idea about the cause of this?
Thanks
I have a problem using rand().
I've been trying to use it in 4 different ways: rand(), rand() % n, rand
() % n-1 and rand() % (high - low + 1) + low with high = 22 and low = 1.
Since rand() is pseudo-random, the results should show a returning
pattern. However, though it works fine in a little rand() test program
giving up to 8 different outcomes, in my real code using either way, the
only outcome I get is 0. Any idea about the cause of this?
Thanks