whats srand((unsinged) time(NULL)) ? helpp | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
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 Resposta
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