0
What exactly works of a srand() ?
We use rand function for random output, but why we use a srand() ? Why we give seed ? And what has done when we add seed by using srand()
1 Answer
0
look in my code there I used the srand () function:
https://code.sololearn.com/cI9E2tOyw6JG/?ref=app
In this case, I used the ctime library and thanks to it, the numbers became random. And the fact is that thanks to ctime we got time going back in 1970 (since the time of language c)