+ 1

Why program is coded as time(0),what does 0imply here.

Time(0)

24th Jun 2016, 2:22 AM
Himanshu singh Bisht
Himanshu singh Bisht - avatar
2 Answers
+ 2
0 is used to tell the program the amount of time computer has been running is that many seconds. the random number is based on how many seconds the program thinks the computer has been on for.
24th Jun 2016, 6:14 AM
Dean Hamilton
Dean Hamilton - avatar
0
so although using srand(time(0)) can be used to get truly random numbers, how truly random are they? For example, if one were to call this method at the same time (in this example, if one were to use this command at 51s) each time would the numbers generated be the same??? If, are the numbers still truly random??
17th Aug 2016, 9:58 AM
Jason Zeleny
Jason Zeleny - avatar