Problem with rand()

I am writing a program that uses the rand() function to generate random numbers between 0 and 9. The problem is it is generating the same random numbers every time i load up my program.
Anyway I can stop this?
Thanks

Mark
At the beginning of your program use srand():
 
srand( time( NULL ) );


Hope this helps.
Sorted, for those who want to know I used this
srand ( time(NULL) );
To initialize it
http://www.cplusplus.com/reference/clibrary/cstdlib/rand.html
Ooh thanks.
I forgot to refresh the page to check whether someone had replied
Someone else told me, but thanks anyway.

Mark
Topic archived. No new replies allowed.