+ 2
What is a seed value and how is it used in the rand function algorithm
2 Antworten
+ 3
A seed value is used to initialize the random number generator. If you run a program multiple times with the same seed value, you'll always get the same "random" numbers. In languages like C(++) you usually use the time as seed (something like srand((unsigned)time(NULL))). That way it is more or less guaranteed that you'll get "unique" (pseudo) random numbers every time you run the program
+ 2
Thanks Anna