On unix I like to do srand(time(NULL) + getpid()), so that if it's a quick little program and you run it multiple times in a second, it will still act random.
gettimeofday() would do the trick as well, but has a bit more of a syntax burden.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.