srand

aclark17 (21)
srand(time(null));
error cannot convert time to int
helios (10258)
srand((unsigned int)time(0));
aclark17 (21)
Same error
aclark17 (21)
time_t works with no cast will this have any effect on the seed
Imadatobanisa (647)
Let us know your time() function syntax.

Edit : thanks pogady, the standard random engine you mentioned is great!
Last edited on
pogrady (525)
time_t works with no cast will this have any effect on the seed


No it won't.

consider using std::default_random_engine which is in <random>.

http://www.cplusplus.com/reference/random/

it works much better.
Topic archived. No new replies allowed.