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.
Quoting from MSDN:
The srand function sets the starting point for generating a series of pseudorandom integers in the current thread.