Logo

Programming-Idioms

History of Idiom 70 > diff from v4 to v5

Edit summary for version 5 by :

Version 4

2015-08-01, 00:25:23

Version 5

2015-08-20, 11:28:02

Idiom #70 Use clock as random generator seed

Get the current date and provide it as a seed to a random generator. The generator sequence will be different at each run.

Idiom #70 Use clock as random generator seed

Get the current date and provide it as a seed to a random generator. The generator sequence will be different at each run.

Imports
#include <stdlib.h>
#include <time.h>
Code
srand((unsigned)time(0));