| Disch (8348) | ||||
|
+1 @ Helios. srand is only being passed time()'s return value. Regardless of the optional 'out' parameter time() takes, it still returns the same thing. Example:
As you can see, output is the same with both forms. To clarify: 't' is not seeding srand(), time()'s return value is. 't' is going unused. | ||||
|
Last edited on
|
||||
| whitenite1 (705) | |
|
@Helios @Disch Thanks for the time(0) info. I thought I read somewhere that time_t t seeded srand, but I guess I misunderstood. Anyway, using the time(0) will make it easier to remember, when I need to use the srand function. | |
|
|
|