0
What happens if you run the program at exactly the same time tomorrow?
Will the number still be 'truly random' or will it repeat itself
1 Odpowiedź
+ 3
time(0) returns the number of seconds since Jan 1, 1970. You won't get the same seed twice with srand(time(0)) (unless you are calling it twice in less than a second).
Also, a pseudo-random number generator is not "truly random" as computers are strictly deterministic machines, it only generates numbers that look random, which is usually good enough for a number of uses, like games and simulations.