rand() isn't very random.

rand() produces the same result every time I run it.

I have rand() % 10 + 1 here and the output always is:

2
8
5
etc.

When I run it again the output is (once again)
2
8
5

How can I make it totally random with different numbers every time I run it?
did you initialize it with time or somethin?
I don't full understand srand and I'm having a hard time with it >.<
Never mind everything is working fine now, thanks Zed :)
You're welcome
...but you are still right. rand() isn't a very good generator. You can find better RNGs on the internet if you need.
Topic archived. No new replies allowed.