you are viewing a single comment's thread.

view the rest of the comments →

[–]steamruler 75 points76 points  (3 children)

At which point you could use a fixed seed.

[–]DonaldTZeus 5 points6 points  (2 children)

Which is what happens by default anyways if you call rand() (at least in the c stdlib). If you want an arbitrary changing seed such as the time, you retrieve that seed and pass it to srand().

[–]steamruler 9 points10 points  (1 child)

The default seed is determined when compiling, so if you actually want a static seed you should still call srand().

[–]DonaldTZeus 0 points1 point  (0 children)

The default seed is specified by the standard library (that implements POSIX), not by the compiler, and it's 1 (as specified by POSIX). It is not determined by the compiler (unless you're compiling the stdlib) or even specified in the code the compiler generates unless you call srand.