rand() function always returns the same value

Jun 30, 2011 at 6:06pm
For some reason, when ever I use the rand() fuction, it always returns the same value.

How do I fix this?
Jun 30, 2011 at 6:06pm
Do you always seed it with the same value?
Jun 30, 2011 at 6:07pm
Whats a seed?
Jun 30, 2011 at 6:09pm
http://www.cplusplus.com/reference/clibrary/cstdlib/rand/

First seed rand with srand()

Then call rand()

Jun 30, 2011 at 6:10pm
Thanks that sovled my problem!!!
Topic archived. No new replies allowed.