The caption pretty much says it.
PS. This is for C++ Windows program.
According to the MSDN documentation on srand() (assuming you are using Microsoft's C runtime library), the seed is thread-local, so you need to call srand() for each thread that is using rand(). Note that this may not be the case in other implementations.
srand()
rand()
Quoting from MSDN:
The srand function sets the starting point for generating a series of pseudorandom integers in the current thread.
2.1m questions
2.1m answers
60 comments
57.0k users