+ 3
What does srand(98) and srand(time (null)) mean?
4 odpowiedzi
+ 7
seeds rand
the first srand(98) will result in repeatable numbers from rand each time the program is run.
the second supplies the system clock time as a seed value. as a result the numbers generated by rand will be different each time the program is run.
+ 6
you are welcome.
note: the seed is the value in the braces
srand(seedValue)
if we supply the number 1 as a seed we will get a certain set of results everytime we use rand but they will be different than if we had supplied 98.
+ 1
thank you
+ 1
Ok, but what if we gave it some other number ?