0

whats srand((unsinged) time(NULL)) ? helpp

I forgot what srand and rand() did please explain. https://code.sololearn.com/c3QVDE635Vjj/?ref=app

31st Jul 2018, 11:01 AM
유현수
유현수 - avatar
1 Odpowiedź
0
srand((unsigned) time(NULL)) just seeds the value that rand() will generate as it is only a pseudo random value, so without srand() rand() would always produce the same result
31st Jul 2018, 11:40 AM
hinanawi
hinanawi - avatar