Everybody hates everybody

rand() always returns the same value

Does this ring a bell to anyone? This only happens when linking to the multithreaded CRT (VC++ 8). I'm seeding srand with time(0).

Since the terms are so generic, I can hardly google it.
Permalink Mr. Powers 
January 18th, 2006
Um, never mind, rubber duck question, figured it out immediately. (srand needs to be called from every thread.)
Permalink Mr. Powers 
January 18th, 2006
Try srand(time(NULL))
Permalink Mat Hall 
January 18th, 2006
In a civilized language, srand() is called automatically when required.
Permalink Mark Warner 
January 18th, 2006

This topic was orginally posted to the off-topic forum of the
Joel on Software discussion board.

Other topics: January, 2006 Other topics: January, 2006 Recent topics Recent topics